((self||this).webpackJsonp=(self||this).webpackJsonp||[]).push([[1],{0:function(e,t,n){"use strict";e.exports=n(936)},1:function(e,t,n){e.exports=n(937)()},10:function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return o})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return u})),n.d(t,"__esDecorate",(function(){return c})),n.d(t,"__runInitializers",(function(){return l})),n.d(t,"__propKey",(function(){return f})),n.d(t,"__setFunctionName",(function(){return h})),n.d(t,"__metadata",(function(){return p})),n.d(t,"__awaiter",(function(){return d})),n.d(t,"__generator",(function(){return m})),n.d(t,"__createBinding",(function(){return v})),n.d(t,"__exportStar",(function(){return g})),n.d(t,"__values",(function(){return y})),n.d(t,"__read",(function(){return b})),n.d(t,"__spread",(function(){return O})),n.d(t,"__spreadArrays",(function(){return w})),n.d(t,"__spreadArray",(function(){return x})),n.d(t,"__await",(function(){return k})),n.d(t,"__asyncGenerator",(function(){return S})),n.d(t,"__asyncDelegator",(function(){return _})),n.d(t,"__asyncValues",(function(){return P})),n.d(t,"__makeTemplateObject",(function(){return E})),n.d(t,"__importStar",(function(){return C})),n.d(t,"__importDefault",(function(){return A})),n.d(t,"__classPrivateFieldGet",(function(){return R})),n.d(t,"__classPrivateFieldSet",(function(){return $})),n.d(t,"__classPrivateFieldIn",(function(){return Q})),n.d(t,"__addDisposableResource",(function(){return I})),n.d(t,"__disposeResources",(function(){return D})),n.d(t,"__rewriteRelativeImportExtension",(function(){return N}));var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=r.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?r.static?e:e.prototype:null,f=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var d={};for(var m in r)d[m]="access"===m?{}:r[m];for(var m in r.access)d.access[m]=r.access[m];d.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var v=(0,n[p])("accessor"===u?{get:f.get,set:f.set}:f[c],d);if("accessor"===u){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(f.get=s),(s=a(v.set))&&(f.set=s),(s=a(v.init))&&i.unshift(s)}else(s=a(v))&&("field"===u?i.unshift(s):f[c]=s)}l&&Object.defineProperty(l,r.name,f),h=!0}function l(e,t,n){for(var r=arguments.length>2,i=0;i0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function O(){for(var e=[],t=0;t1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof k?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:k(e[r](t)),done:!1}:i?i(t):t}:i}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=y(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},j(e)};function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=j(e),r=0;r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n9&&void 0!==arguments[9]?arguments[9]:0,f=arguments.length>10?arguments[10]:void 0;d(this,e),this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=a,this.buffer=s,this.bufferBase=u,this.curContext=c,this.lookAhead=l,this.parent=f}return v(e,[{key:"toString",value:function(){return"[".concat(this.stack.filter((function(e,t){return t%3==0})).concat(this.state),"]@").concat(this.pos).concat(this.score?"!"+this.score:"")}},{key:"context",get:function(){return this.curContext?this.curContext.context:null}},{key:"pushState",value:function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}},{key:"reduce",value:function(e){var t,n=e>>19,r=65535&e,i=this.p.parser,o=this.reducePos=2e3&&!(null===(t=this.p.parser.nodeSet.types[r])||void 0===t?void 0:t.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(r,u)}},{key:"storeNode",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==o.buffer[a-4]&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t)return void(o.buffer[a-2]=n)}}if(i&&this.pos!=n){var s=this.buffer.length;if(s>0&&0!=this.buffer[s-4]){for(var u=!1,c=s;c>0&&this.buffer[c-2]>n;c-=4)if(this.buffer[c-1]>=0){u=!0;break}if(u)for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4)}this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=r}else this.buffer.push(e,t,n,r)}},{key:"shift",value:function(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var i=e,o=this.p.parser;(r>this.pos||t<=o.maxNode)&&(this.pos=r,o.stateFlag(i,1)||(this.reducePos=r)),this.pushState(i,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}},{key:"apply",value:function(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}},{key:"useNode",value:function(e,t){var n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);var r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}},{key:"split",value:function(){for(var t=this,n=t.buffer.length;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;for(var r=t.buffer.slice(n),i=t.bufferBase+n;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}},{key:"recoverByDelete",value:function(e,t){var n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}},{key:"canShift",value:function(e){for(var t=new O(this);;){var n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(0==(65536&n))return!0;t.reduce(n)}}},{key:"recoverByInsert",value:function(e){if(this.stack.length>=300)return[];var t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){for(var n,r=[],i=0;i>19,r=65535&t,i=this.stack.length-3*n;if(i<0||e.getGoto(this.stack[i],r,!1)<0){var o=this.findForcedReduction();if(null==o)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}},{key:"findForcedReduction",value:function(){var e=this,t=this.p.parser,n=[];return function r(i,o){if(!n.includes(i))return n.push(i),t.allActions(i,(function(n){if(393216&n);else if(65536&n){var i=(n>>19)-o;if(i>1){var a=65535&n,s=e.stack.length-3*i;if(s>=0&&t.getGoto(e.stack[s],a,!1)>=0)return i<<19|65536|a}}else{var u=r(n,o+1);if(null!=u)return u}}))}(this.state,0)}},{key:"forceAll",value:function(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}},{key:"deadEnd",get:function(){if(3!=this.stack.length)return!1;var e=this.p.parser;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}},{key:"restart",value:function(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}},{key:"sameState",value:function(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(var t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}},{key:"close",value:function(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}],[{key:"start",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new b(i,i.start):null,0,null)}}]),e}(),b=v((function e(t,n){d(this,e),this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0})),O=function(){function e(t){d(this,e),this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}return v(e,[{key:"reduce",value:function(e){var t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);var r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}]),e}(),w=function(){function e(t,n,r){d(this,e),this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,0==this.index&&this.maybeNext()}return v(e,[{key:"maybeNext",value:function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"next",value:function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}},{key:"fork",value:function(){return new e(this.stack,this.pos,this.index)}}],[{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.bufferBase+t.buffer.length;return new e(t,n,n-t.bufferBase)}}]),e}();function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uint16Array;if("string"!=typeof e)return e;for(var n=null,r=0,i=0;r=92&&a--,a>=34&&a--;var u=a-32;if(u>=46&&(u-=46,s=!0),o+=u,s)break;o*=46}n?n[i++]=o:n=new t(o)}return n}var k=v((function e(){d(this,e),this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0})),S=new k,_=function(){function e(t,n){d(this,e),this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=S,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}return v(e,[{key:"resolveOffset",value:function(e,t){for(var n=this.range,r=this.rangeIndex,i=this.pos+e;in.to:i>=n.to;){if(r==this.ranges.length-1)return null;var a=this.ranges[++r];i+=a.from-n.to,n=a}return i}},{key:"clipPos",value:function(e){if(e>=this.range.from&&ee)return Math.max(e,r.from)}}catch(e){n.e(e)}finally{n.f()}return this.end}},{key:"peek",value:function(e){var t,n,r=this.chunkOff+e;if(r>=0&&r=this.chunk2Pos&&ta.to&&(this.chunk2=this.chunk2.slice(0,a.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}},{key:"acceptToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}},{key:"readNext",value:function(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}},{key:"advance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}},{key:"setDone",value:function(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}},{key:"reset",value:function(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=S,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);var n,r="",i=l(this.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.from>=t)break;o.to>e&&(r+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}}catch(e){i.e(e)}finally{i.f()}return r}}]),e}(),P=function(){function e(t,n){d(this,e),this.data=t,this.id=n}return v(e,[{key:"token",value:function(e,t){var n=t.p.parser;j(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}]),e}();P.prototype.contextual=P.prototype.fallback=P.prototype.extend=!1;var E=function(){function e(t,n,r){d(this,e),this.precTable=n,this.elseToken=r,this.data="string"==typeof t?x(t):t}return v(e,[{key:"token",value:function(e,t){for(var n=e.pos,r=0;;){var i=e.next<0,o=e.resolveOffset(1,1);if(j(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(i||r++,null==o)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}]),e}();E.prototype.contextual=P.prototype.fallback=P.prototype.extend=!1;var T=v((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};d(this,e),this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}));function j(e,t,n,r,i,o){var a,s,u,c,l,f=0,h=1<0){var v=e[m];if(p.allows(v)&&(-1==t.token.value||t.token.value==v||(a=v,s=t.token.value,l=void 0,(l=C(u=i,c=o,s))<0||C(u,c,a)y&&65535==e[d+3*b-3])){for(;y>1,w=d+O+(O<<1),x=e[w],k=e[w+1]||65536;if(g=k)){f=e[w+2],t.advance();continue e}y=O+1}}break}f=e[d+3*b-1]}}function C(e,t,n){for(var r,i=t;65535!=(r=e[i]);i++)if(r==n)return i-t;return-1}var A=void 0!==e&&e.env&&/\bparse\b/.test(e.env.LOG),R=null;function $(e,t,n){var i=e.cursor(r.b.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.tot)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}var Q=function(){function e(t,n){d(this,e),this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}return v(e,[{key:"nextFragment",value:function(){var e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?$(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?$(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}},{key:"nodeAt",value:function(e){if(ee)return this.nextStart=a,null;if(o instanceof r.h){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+o.length}else this.trees.pop(),this.start.pop(),this.index.pop()}}}]),e}(),I=function(){function e(t,n){d(this,e),this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((function(e){return new k}))}return v(e,[{key:"getActions",value:function(e){for(var t=0,n=null,r=e.p.parser,i=r.tokenizers,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0,u=0;ul.end+25&&(s=Math.max(l.lookAhead,s)),0!=l.value)){var f=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new k).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}},{key:"getMainToken",value:function(e){if(this.mainToken)return this.mainToken;var t=new k,n=e.pos,r=e.p;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}},{key:"updateCachedToken",value:function(e,t,n){var r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){for(var i=n.p.parser,o=0;o=0&&n.p.parser.dialect.allows(a>>1)){0==(1&a)?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}},{key:"putAction",value:function(e,t,n,r){for(var i=0;i4*t.bufferLength?new Q(r,t.nodeSet):null}return v(e,[{key:"parsedPos",get:function(){return this.minStackPos}},{key:"advance",value:function(){var e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){for(var o=c(n,1)[0];o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(var a=0;ar)i.push(s);else{if(this.advanceStack(s,i,n))continue;e||(e=[],t=[]),e.push(s);var u=this.tokens.getMainToken(s);t.push(u.value,u.end)}break}if(!i.length){var f=e&&function(e){var t,n=null,r=l(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=o&&i.pos>o)&&i.p.parser.stateFlag(i.state,2)&&(!n||n.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,i);if(h)return A&&console.log("Force-finish "+this.stackID(h)),this.stackToTree(h.forceAll())}if(this.recovering){var p=1==this.recovering?1:3*this.recovering;if(i.length>p)for(i.sort((function(e,t){return t.score-e.score}));i.length>p;)i.pop();i.some((function(e){return e.reducePos>r}))&&this.recovering--}else if(i.length>1){e:for(var d=0;d500&&g.buffer.length>500){if(!((m.score-g.score||m.buffer.length-g.buffer.length)>0)){i.splice(d--,1);continue e}i.splice(v--,1)}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(var y=1;y ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments)for(var s=e.curContext&&e.curContext.tracker.strict,u=s?e.curContext.hash:0,c=this.fragments.nodeAt(i);c;){var l=this.parser.nodeSet.types[c.type.id]==c.type?o.getGoto(e.state,c.type.id):-1;if(l>-1&&c.length&&(!s||(c.prop(r.c.contextHash)||0)==u))return e.useNode(c,l),A&&console.log(a+this.stackID(e)+" (via reuse of ".concat(o.getName(c.type.id),")")),!0;if(!(c instanceof r.h)||0==c.children.length||c.positions[0]>0)break;var f=c.children[0];if(!(f instanceof r.h&&0==c.positions[0]))break;c=f}var h=o.stateSlot(e.state,4);if(h>0)return e.reduce(h),A&&console.log(a+this.stackID(e)+" (via always-reduce ".concat(o.getName(65535&h),")")),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););for(var p=this.tokens.getActions(e),d=0;di?t.push(b):n.push(b)}return!1}},{key:"advanceFully",value:function(e,t){for(var n=e.pos;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return D(e,t),!0}}},{key:"runRecovery",value:function(e,t,n){for(var r=null,i=!1,o=0;o ":"";if(a.deadEnd){if(i)continue;if(i=!0,a.restart(),A&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))continue}for(var f=a.split(),h=c,p=0;f.forceReduce()&&p<10;p++){if(A&&console.log(h+this.stackID(f)+" (via force-reduce)"),this.advanceFully(f,n))break;A&&(h=this.stackID(f)+" -> ")}var d,m=l(a.recoverByInsert(s));try{for(m.s();!(d=m.n()).done;){var v=d.value;A&&console.log(c+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,n)}}catch(e){m.e(e)}finally{m.f()}this.stream.end>a.pos?(u==a.pos&&(u++,s=0),a.recoverByDelete(s,u),A&&console.log(c+this.stackID(a)+" (via recover-delete ".concat(this.parser.getName(s),")")),D(a,n)):(!r||r.score=0)p(O,y,g[b++]);else{for(var w=g[b+-O],k=-O;k>0;k--)p(g[b++],y,w);b++}}}}catch(e){v.e(e)}finally{v.f()}}a.nodeSet=new r.d(s.map((function(t,n){return r.e.define({name:n>=a.minRepeatTerm?void 0:t,id:n,props:f[n],top:c.indexOf(n)>-1,error:0==n,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1})}))),e.propSources&&(a.nodeSet=(n=a.nodeSet).extend.apply(n,i(e.propSources))),a.strict=!1,a.bufferLength=r.a;var S=x(e.tokenData);a.context=e.context,a.specializerSpecs=e.specialized||[],a.specialized=new Uint16Array(a.specializerSpecs.length);for(var _=0;_2&&void 0!==arguments[2]&&arguments[2],r=this.goto;if(t>=r[0])return-1;for(var i=r[t+1];;){var o=r[i++],a=1&o,s=r[i++];if(a&&n)return s;for(var u=i+(o>>1);i0}},{key:"validAction",value:function(e,t){return!!this.allActions(e,(function(e){return e==t||null}))}},{key:"allActions",value:function(e,t){for(var n=this.stateSlot(e,4),r=n?t(n):void 0,i=this.stateSlot(e,1);null==r;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=z(this.data,i+2)}r=t(z(this.data,i+1))}return r}},{key:"nextStates",value:function(e){for(var t=this,n=[],r=function(e){if(65535==t.data[e]){if(1!=t.data[e+1])return i=e,1;e=z(t.data,e+2)}if(0==(1&t.data[e+2])){var r=t.data[e+1];n.some((function(e,t){return 1&t&&e==r}))||n.push(t.data[e],r)}i=e},i=this.stateSlot(e,1);!r(i);i+=3);return n}},{key:"configure",value:function(e){var n,r=Object.assign(Object.create(t.prototype),this);if(e.props&&(r.nodeSet=(n=this.nodeSet).extend.apply(n,i(e.props))),e.top){var o=this.topRules[e.top];if(!o)throw new RangeError("Invalid top rule name ".concat(e.top));r.top=o}return e.tokenizers&&(r.tokenizers=this.tokenizers.map((function(t){var n=e.tokenizers.find((function(e){return e.from==t}));return n?n.to:t}))),e.specializers&&(r.specializers=this.specializers.slice(),r.specializerSpecs=this.specializerSpecs.map((function(t,n){var i=e.specializers.find((function(e){return e.from==t.external}));if(!i)return t;var o=Object.assign(Object.assign({},t),{external:i.to});return r.specializers[n]=U(o),o}))),e.contextTracker&&(r.context=e.contextTracker),e.dialect&&(r.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(r.strict=e.strict),e.wrap&&(r.wrappers=r.wrappers.concat(e.wrap)),null!=e.bufferLength&&(r.bufferLength=e.bufferLength),r}},{key:"hasWrappers",value:function(){return this.wrappers.length>0}},{key:"getName",value:function(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}},{key:"eofTerm",get:function(){return this.maxNode+1}},{key:"topNode",get:function(){return this.nodeSet.types[this.top[1]]}},{key:"dynamicPrecedence",value:function(e){var t=this.dynamicPrecedences;return null==t?0:t[e]||0}},{key:"parseDialect",value:function(e){var t=Object.keys(this.dialects),n=t.map((function(){return!1}));if(e){var r,i=l(e.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value,a=t.indexOf(o);a>=0&&(n[a]=!0)}}catch(e){i.e(e)}finally{i.f()}}for(var s=null,u=0;u{if(t&&"object"==typeof t||"function"==typeof t)for(let i of s(t))!c.call(e,i)&&i!==n&&o(e,i,{get:()=>t[i],enumerable:!(r=a(t,i))||r.enumerable});return e},f=(e,t,n)=>(n=null!=e?i(u(e)):{},l(!t&&e&&e.__esModule?n:o(n,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})})(h,{CheckmarkIcon:()=>V,ErrorIcon:()=>F,LoaderIcon:()=>z,ToastBar:()=>ne,ToastIcon:()=>H,Toaster:()=>se,default:()=>ue,resolveValue:()=>p,toast:()=>P,useToaster:()=>C,useToasterStore:()=>S}),e.exports=(r=h,l(o({},"__esModule",{value:!0}),r));var p=(e,t)=>(e=>"function"==typeof e)(e)?e(t):e,d=(()=>{let e=0;return()=>(++e).toString()})(),m=(()=>{let e;return()=>{if(void 0===e&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),v=n(0),g=new Map,y=e=>{if(g.has(e))return;let t=setTimeout((()=>{g.delete(e),x({type:4,toastId:e})}),1e3);g.set(e,t)},b=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return t.toast.id&&(e=>{let t=g.get(e);t&&clearTimeout(t)})(t.toast.id),{...e,toasts:e.toasts.map((e=>e.id===t.toast.id?{...e,...t.toast}:e))};case 2:let{toast:n}=t;return e.toasts.find((e=>e.id===n.id))?b(e,{type:1,toast:n}):b(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?y(r):e.toasts.forEach((e=>{y(e.id)})),{...e,toasts:e.toasts.map((e=>e.id===r||void 0===r?{...e,visible:!1}:e))};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter((e=>e.id!==t.toastId))};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map((e=>({...e,pauseDuration:e.pauseDuration+i})))}}},O=[],w={toasts:[],pausedAt:void 0},x=e=>{w=b(w,e),O.forEach((e=>{e(w)}))},k={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},S=(e={})=>{let[t,n]=(0,v.useState)(w);(0,v.useEffect)((()=>(O.push(n),()=>{let e=O.indexOf(n);e>-1&&O.splice(e,1)})),[t]);let r=t.toasts.map((t=>{var n,r;return{...e,...e[t.type],...t,duration:t.duration||(null==(n=e[t.type])?void 0:n.duration)||(null==e?void 0:e.duration)||k[t.type],style:{...e.style,...null==(r=e[t.type])?void 0:r.style,...t.style}}}));return{...t,toasts:r}},_=e=>(t,n)=>{let r=((e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(null==n?void 0:n.id)||d()}))(t,e,n);return x({type:2,toast:r}),r.id},P=(e,t)=>_("blank")(e,t);P.error=_("error"),P.success=_("success"),P.loading=_("loading"),P.custom=_("custom"),P.dismiss=e=>{x({type:3,toastId:e})},P.remove=e=>x({type:4,toastId:e}),P.promise=(e,t,n)=>{let r=P.loading(t.loading,{...n,...null==n?void 0:n.loading});return e.then((e=>(P.success(p(t.success,e),{id:r,...n,...null==n?void 0:n.success}),e))).catch((e=>{P.error(p(t.error,e),{id:r,...n,...null==n?void 0:n.error})})),e};var E=n(0),T=(e,t)=>{x({type:1,toast:{id:e,height:t}})},j=()=>{x({type:5,time:Date.now()})},C=e=>{let{toasts:t,pausedAt:n}=S(e);(0,E.useEffect)((()=>{if(n)return;let e=Date.now(),r=t.map((t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(n<0))return setTimeout((()=>P.dismiss(t.id)),n);t.visible&&P.dismiss(t.id)}));return()=>{r.forEach((e=>e&&clearTimeout(e)))}}),[t,n]);let r=(0,E.useCallback)((()=>{n&&x({type:6,time:Date.now()})}),[n]),i=(0,E.useCallback)(((e,n)=>{let{reverseOrder:r=!1,gutter:i=8,defaultPosition:o}=n||{},a=t.filter((t=>(t.position||o)===(e.position||o)&&t.height)),s=a.findIndex((t=>t.id===e.id)),u=a.filter(((e,t)=>te.visible)).slice(...r?[u+1]:[0,u]).reduce(((e,t)=>e+(t.height||0)+i),0)}),[t]);return{toasts:t,handlers:{updateHeight:T,startPause:j,endPause:r,calculateOffset:i}}},A=f(n(0)),R=n(573),$=f(n(0)),Q=n(573),I=n(573),M=I.keyframes` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,D=I.keyframes` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,N=I.keyframes` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,F=(0,I.styled)("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${M} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${D} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${e=>e.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${N} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,L=n(573),q=L.keyframes` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,z=(0,L.styled)("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${e=>e.secondary||"#e0e0e0"}; border-right-color: ${e=>e.primary||"#616161"}; animation: ${q} 1s linear infinite; `,U=n(573),B=U.keyframes` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Z=U.keyframes` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,V=(0,U.styled)("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${B} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${Z} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${e=>e.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,W=(0,Q.styled)("div")` position: absolute; `,X=(0,Q.styled)("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,Y=Q.keyframes` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,G=(0,Q.styled)("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${Y} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,H=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return void 0!==t?"string"==typeof t?$.createElement(G,null,t):t:"blank"===n?null:$.createElement(X,null,$.createElement(z,{...r}),"loading"!==n&&$.createElement(W,null,"error"===n?$.createElement(F,{...r}):$.createElement(V,{...r})))},K=e=>`\n0% {transform: translate3d(0,${-200*e}%,0) scale(.6); opacity:.5;}\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\n`,J=e=>`\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\n100% {transform: translate3d(0,${-150*e}%,-1px) scale(.6); opacity:0;}\n`,ee=(0,R.styled)("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,te=(0,R.styled)("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,ne=A.memo((({toast:e,position:t,style:n,children:r})=>{let i=e.height?((e,t)=>{let n=e.includes("top")?1:-1,[r,i]=m()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[K(n),J(n)];return{animation:t?`${(0,R.keyframes)(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${(0,R.keyframes)(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||t||"top-center",e.visible):{opacity:0},o=A.createElement(H,{toast:e}),a=A.createElement(te,{...e.ariaProps},p(e.message,e));return A.createElement(ee,{className:e.className,style:{...i,...n,...e.style}},"function"==typeof r?r({icon:o,message:a}):A.createElement(A.Fragment,null,o,a))})),re=n(573),ie=f(n(0));(0,re.setup)(ie.createElement);var oe=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let o=ie.useCallback((t=>{if(t){let n=()=>{let n=t.getBoundingClientRect().height;r(e,n)};n(),new MutationObserver(n).observe(t,{subtree:!0,childList:!0,characterData:!0})}}),[e,r]);return ie.createElement("div",{ref:o,className:t,style:n},i)},ae=re.css` z-index: 9999; > * { pointer-events: auto; } `,se=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:s,handlers:u}=C(n);return ie.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...o},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},s.map((n=>{let o=n.position||t,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:m()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}})(o,u.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return ie.createElement(oe,{id:n.id,key:n.id,onHeightUpdate:u.updateHeight,className:n.visible?ae:"",style:a},"custom"===n.type?p(n.message,n):i?i(n):ie.createElement(ne,{toast:n,position:o}))})))},ue=P},1092:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(54),i=n(790);function o(e){return Object(i.a)(r.useCallback((function(t){return e.onNextChange((function n(){t(),e.onNextChange(n)}))}),[e]),e,e)}},1093:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(571);function i(e){return new r.a((function(t){t.error(e)}))}},1094:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(10),i=n(18),o=n(42),a=n(166),s=n(771),u=n(349),c=n(576),l=n(571),f=n(839),h=n(86);function p(e,t){var n={query:e.query&&Object(s.a)(t?Object(u.a)(e.query):e.query)};return JSON.stringify(n)}var d=function(e){function t(t,n,r){var i;void 0===n&&(n=!0),void 0===r&&(r=Object.create(null));var o=e.call(this)||this;return o.addTypename=!0,o.showWarnings=!0,o.mockedResponsesByKey={},o.addTypename=n,o.showWarnings=null===(i=r.showWarnings)||void 0===i||i,t&&t.forEach((function(e){o.addMockedResponse(e)})),o}return Object(r.__extends)(t,e),t.prototype.addMockedResponse=function(e){var t=this.normalizeMockedResponse(e),n=p(t.request,this.addTypename),r=this.mockedResponsesByKey[n];r||(r=[],this.mockedResponsesByKey[n]=r),r.push(t)},t.prototype.request=function(e){var t,n=this;this.operation=e;var r,i=p(e,this.addTypename),a=[],u=e.variables||{},f=this.mockedResponsesByKey[i],h=f?f.findIndex((function(t,n){var r=t.request.variables||{};return!!Object(o.b)(u,r)||(!(!t.variableMatcher||!t.variableMatcher(e.variables))||(a.push(r),!1))})):-1,d=h>=0?f[h]:void 0,m=(null==d?void 0:d.delay)===1/0?0:null!==(t=null==d?void 0:d.delay)&&void 0!==t?t:0;if(d){d.maxUsageCount&&d.maxUsageCount>1?d.maxUsageCount--:f.splice(h,1);var v=d.newData;v&&(d.result=v(e.variables),f.push(d)),d.result||d.error||d.delay===1/0||(r=new Error("Mocked response should contain either `result`, `error` or a `delay` of `Infinity`: ".concat(i)))}else r=new Error("No more mocked responses for the query: ".concat(Object(s.a)(e.query),"\nExpected variables: ").concat(Object(c.a)(e.variables),"\n").concat(a.length>0?"\nFailed to match ".concat(a.length," mock").concat(1===a.length?"":"s"," for this query. The mocked response had the following variables:\n").concat(a.map((function(e){return" ".concat(Object(c.a)(e))})).join("\n"),"\n"):"")),this.showWarnings&&console.warn(r.message+"\nThis typically indicates a configuration error in your mocks setup, usually due to a typo or mismatched variable.");return new l.a((function(t){var i=setTimeout((function(){if(r)try{if(!1!==n.onError(r,t))throw r}catch(e){t.error(e)}else d&&d.delay!==1/0&&(d.error?t.error(d.error):(d.result&&t.next("function"==typeof d.result?d.result(e.variables):d.result),t.complete()))}),m);return function(){clearTimeout(i)}}))},t.prototype.normalizeMockedResponse=function(e){var t,n=Object(f.a)(e),r=Object(u.f)([{name:"connection"},{name:"nonreactive"}],Object(h.a)(n.request.query));Object(i.c)(r,67),n.request.query=r;var o=Object(u.d)(n.request.query);return o&&(n.request.query=o),e.maxUsageCount=null!==(t=e.maxUsageCount)&&void 0!==t?t:1,Object(i.c)(e.maxUsageCount>0,68,e.maxUsageCount),this.normalizeVariableMatching(n),n},t.prototype.normalizeVariableMatching=function(e){var t=e.request;if(e.variableMatcher&&t.variables)throw new Error("Mocked response should contain either variableMatcher or request.variables");e.variableMatcher||(t.variables=Object(r.__assign)(Object(r.__assign)({},Object(h.b)(Object(h.f)(t.query))),t.variables),e.variableMatcher=function(e){var n=e||{},r=t.variables||{};return Object(o.b)(n,r)})},t}(a.a)},1095:function(e,t,n){"use strict";n.d(t,"a",(function(){return Re}));var r=n(10),i=n(18),o=n(187),a=n(42),s=n(388),u=n(588),c=n(571),l=n(501),f=n(862),h=n(240),p=n(793),d=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Object(o.c)(s.c,{max:u.a["cache.fragmentQueryDocuments"]||1e3,cache:f.a})}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(Object(r.__assign)(Object(r.__assign)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.watchFragment=function(e){var t,n=this,i=e.fragment,o=e.fragmentName,a=e.from,s=e.optimistic,u=void 0===s||s,f=Object(r.__rest)(e,["fragment","fragmentName","from","optimistic"]),h=this.getFragmentDoc(i,o),d=Object(r.__assign)(Object(r.__assign)({},f),{returnPartialData:!0,id:void 0===a||"string"==typeof a?a:this.identify(a),query:h,optimistic:u});return new c.a((function(e){return n.watch(Object(r.__assign)(Object(r.__assign)({},d),{immediate:!0,callback:function(n){if(!t||!Object(p.a)(h,{data:null==t?void 0:t.result},{data:n.result})){var r={data:n.result,complete:!!n.complete};n.missing&&(r.missing=Object(l.c)(n.missing.map((function(e){return e.missing})))),t=n,e.next(r)}}}))}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(Object(r.__assign)(Object(r.__assign)({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,i=Object(r.__rest)(e,["id","data"]);return this.write(Object.assign(i,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,i=e.fragment,o=e.fragmentName,a=Object(r.__rest)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(i,o),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var i=n.readQuery(e),o=t(i);return null==o?i:(n.writeQuery(Object(r.__assign)(Object(r.__assign)({},e),{data:o})),o)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var i=n.readFragment(e),o=t(i);return null==o?i:(n.writeFragment(Object(r.__assign)(Object(r.__assign)({},e),{data:o})),o)}})},e}();!1!==globalThis.__DEV__&&(d.prototype.getMemoryInternals=h.a);var m=function(e){function t(n,r,i,o){var a,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=o,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((a={})[s.path[u]]=s.missing,a)}else s.missing=s.path;return s.__proto__=t.prototype,s}return Object(r.__extends)(t,e),t}(Error),v=n(874),g=n(349),y=n(785),b=n(771),O=n(117),w=n(36),x=n(393),k=n(616),S=n(86),_=n(411),P=n(871),E=n(151),T=n(356),j=n(354),C=Object.prototype.hasOwnProperty;function A(e){return null==e}function R(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=A(r)?A(i)?void 0:{_id:i}:{id:r}),A(r)&&!A(i)&&(r=i),!A(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var $={dataIdFromObject:R,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Q(e){var t=e.canonizeResults;return void 0===t?$.canonizeResults:t}var I=/^[_a-z][_0-9a-z]*/i;function M(e){var t=e.match(I);return t?t[0]:e}function D(e,t,n){return!!Object(E.a)(t)&&(Object(j.a)(t)?t.every((function(t){return D(e,t,n)})):e.selections.every((function(e){if(Object(O.e)(e)&&Object(_.g)(e,n)){var r=Object(O.i)(e);return C.call(t,r)&&(!e.selectionSet||D(e.selectionSet,t[r],n))}return!0})))}function N(e){return Object(E.a)(e)&&!Object(O.g)(e)&&!Object(j.a)(e)}function F(e,t){var n=Object(s.a)(Object(S.d)(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var L,q,z=Object.create(null),U=function(){return z},B=Object.create(null),Z=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Object(P.a)(Object(O.g)(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return Object(O.g)(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Object(O.h)(e);if(Object(O.g)(e))return e;var r=n.policies.identify(e)[0];if(r){var i=Object(O.h)(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return Object(r.__assign)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),C.call(this.data,e)){var n=this.data[e];if(n&&C.call(n,t))return n[t]}return"__typename"===t&&C.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Y?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),C.call(this.data,e)?this.data[e]:this instanceof Y?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;Object(O.g)(e)&&(e=e.__ref),Object(O.g)(t)&&(t=t.__ref);var o="string"==typeof e?this.lookup(n=e):e,a="string"==typeof t?this.lookup(n=t):t;if(a){Object(i.c)("string"==typeof n,1);var s=new l.a(H).merge(o,a);if(this.data[n]=s,s!==o&&(delete this.refs[n],this.group.caching)){var u=Object.create(null);o||(u.__exists=1),Object.keys(a).forEach((function(e){if(!o||o[e]!==s[e]){u[e]=1;var t=M(e);t===e||r.policies.hasKeyArgs(s.__typename,t)||(u[t]=1),void 0!==s[e]||r instanceof Y||delete s[e]}})),!u.__typename||o&&o.__typename||this.policies.rootTypenamesById[n]!==s.__typename||delete u.__typename,Object.keys(u).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,o=this.lookup(e);if(o){var a=Object.create(null),s=!1,u=!0,c={DELETE:z,INVALIDATE:B,isReference:O.g,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||Object(O.h)(e)}:t,{store:n})}};if(Object.keys(o).forEach((function(l){var f=M(l),h=o[l];if(void 0!==h){var p="function"==typeof t?t:t[l]||t[f];if(p){var d=p===U?z:p(Object(P.a)(h),Object(r.__assign)(Object(r.__assign)({},c),{fieldName:f,storeFieldName:l,storage:n.getStorage(e,l)}));if(d===B)n.group.dirty(e,l);else if(d===z&&(d=void 0),d!==h&&(a[l]=d,s=!0,h=d,!1!==globalThis.__DEV__)){var m=function(e){if(void 0===n.lookup(e.__ref))return!1!==globalThis.__DEV__&&i.c.warn(2,e),!0};if(Object(O.g)(d))m(d);else if(Array.isArray(d))for(var v=!1,g=void 0,y=0,b=d;y0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Y?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){C.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof Y;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!C.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){Object(O.g)(e)&&(t[e.__ref]=!0),Object(E.a)(e)&&Object.keys(e).forEach((function(t){var n=e[t];Object(E.a)(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),V=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Object(o.b)():null,this.keyMaker=new T.a(x.e)},e.prototype.depend=function(e,t){if(this.d){this.d(W(e,t));var n=M(t);n!==t&&this.d(W(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(W(e,t),"__exists"===t?"forget":"setDirty")},e}();function W(e,t){return t+"#"+e}function X(e,t){K(e)&&e.group.depend(t,"__exists")}L=Z||(Z={}),q=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,a=e.call(this,n,new V(i))||this;return a.stump=new G(a),a.storageTrie=new T.a(x.e),o&&a.replace(o),a}return Object(r.__extends)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(L),L.Root=q;var Y=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return Object(r.__extends)(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){Object(a.b)(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return Object(r.__assign)(Object(r.__assign)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return C.call(this.data,t)?Object(r.__assign)(Object(r.__assign)({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Z),G=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new V(t.group.caching,t.group))||this}return Object(r.__extends)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(Y);function H(e,t,n){var r=e[n],i=t[n];return Object(a.b)(r,i)?r:i}function K(e){return!!(e instanceof Z&&e.group.caching)}var J=function(){function e(){this.known=new(x.f?WeakSet:Set),this.pool=new T.a(x.e),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return Object(E.a)(e)&&this.known.has(e)},e.prototype.pass=function(e){if(Object(E.a)(e)){var t=function(e){return Object(E.a)(e)?Object(j.a)(e)?e.slice(0):Object(r.__assign)({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(Object(E.a)(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),!1!==globalThis.__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],a=this.sortedKeys(e);o.push(a.json);var s,u=o.length;if(a.sorted.forEach((function(n){o.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(o)).object){var c=s.object=Object.create(i);this.known.add(c),a.sorted.forEach((function(e,t){c[e]=o[u+t]})),!1!==globalThis.__DEV__&&Object.freeze(c)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}();function ee(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var te=function(){function e(e){var t=this;this.knownResults=new(x.e?WeakMap:Map),this.config=Object(k.a)(e,{addTypename:!1!==e.addTypename,canonizeResults:Q(e)}),this.canon=e.canon||new J,this.executeSelectionSet=Object(o.c)((function(e){var n,i=e.context.canonizeResults,o=ee(e);o[3]=!i;var a=(n=t.executeSelectionSet).peek.apply(n,o);return a?i?Object(r.__assign)(Object(r.__assign)({},a),{result:t.canon.admit(a.result)}):a:(X(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize||u.a["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:ee,makeCacheKey:function(e,t,n,r){if(K(n.store))return n.store.makeCacheKey(e,Object(O.g)(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Object(o.c)((function(e){return X(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize||u.a["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(K(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new J},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,i=e.rootId,o=void 0===i?"ROOT_QUERY":i,a=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;a=Object(r.__assign)(Object(r.__assign)({},Object(S.b)(Object(S.h)(n))),a);var h,p=Object(O.h)(o),d=this.executeSelectionSet({selectionSet:Object(S.e)(n).selectionSet,objectOrReference:p,enclosingRef:p,context:Object(r.__assign)({store:t,query:n,policies:f,variables:a,varString:Object(y.a)(a),canonizeResults:l},F(n,this.config.fragments))});if(d.missing&&(h=[new m(ne(d.missing),d.missing,n,a)],!u))throw h[0];return{result:d.result,complete:!h,missing:h}},e.prototype.isFresh=function(e,t,n,r){if(K(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,o=e.enclosingRef,a=e.context;if(Object(O.g)(r)&&!a.policies.rootTypenamesById[r.__ref]&&!a.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var u,c=a.variables,f=a.policies,h=a.store.getFieldValue(r,"__typename"),p=[],d=new l.a;function m(e,t){var n;return e.missing&&(u=d.merge(u,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof h&&!f.rootIdsByTypename[h]&&p.push({__typename:h});var v=new Set(n.selections);v.forEach((function(e){var n,l;if(Object(_.g)(e,c))if(Object(O.e)(e)){var y=f.readField({fieldName:e.name.value,field:e,variables:a.variables,from:r},a),b=Object(O.i)(e);void 0===y?g.a.added(e)||(u=d.merge(u,((n={})[b]="Can't find field '".concat(e.name.value,"' on ").concat(Object(O.g)(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Object(j.a)(y)?y.length>0&&(y=m(t.executeSubSelectedArray({field:e,array:y,enclosingRef:o,context:a}),b)):e.selectionSet?null!=y&&(y=m(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:y,enclosingRef:Object(O.g)(y)?y:o,context:a}),b)):a.canonizeResults&&(y=t.canon.pass(y)),void 0!==y&&p.push(((l={})[b]=y,l))}else{var x=Object(s.b)(e,a.lookupFragment);if(!x&&e.kind===w.a.FRAGMENT_SPREAD)throw Object(i.e)(9,e.name.value);x&&f.fragmentMatches(x,h)&&x.selectionSet.selections.forEach(v.add,v)}}));var y={result:Object(l.c)(p),missing:u},b=a.canonizeResults?this.canon.admit(y):Object(P.a)(y);return b.result&&this.knownResults.set(b.result,n),b},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,o=e.array,a=e.enclosingRef,s=e.context,u=new l.a;function c(e,n){var r;return e.missing&&(t=u.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(o=o.filter(s.store.canRead)),o=o.map((function(e,t){return null===e?null:Object(j.a)(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:a,context:s}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:Object(O.g)(e)?e:a,context:s}),t):(!1!==globalThis.__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){Object(E.a)(n)&&(Object(i.c)(!Object(O.g)(n),10,function(e,t){return Object(O.g)(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n),t.name.value),Object.values(n).forEach(r.add,r))}))}}(s.store,r,e),e)})),{result:s.canonizeResults?this.canon.admit(o):o,missing:t}},e}();function ne(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var re=n(839),ie=n(576),oe=n(565),ae=Object.create(null);function se(e){var t=JSON.stringify(e);return ae[t]||(ae[t]=Object.create(null))}function ue(e){var t=se(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},o=n.keyObject=le(e,(function(e){var o=pe(n.storeObject,e,r);return void 0===o&&t!==n.storeObject&&C.call(t,e[0])&&(o=pe(t,e,he)),Object(i.c)(void 0!==o,4,e.join("."),t),o}));return"".concat(n.typename,":").concat(JSON.stringify(o))})}function ce(e){var t=se(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,a=le(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return pe(t,e)}else{var a=n.slice(1);if(i&&C.call(i,a)){var s=e.slice(0);return s[0]=a,pe(i,s)}}else if(r&&Object(j.b)(r.directives)){var u=n.slice(1),c=r.directives.find((function(e){return e.name.value===u})),l=c&&Object(O.a)(c,i);return l&&pe(l,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function le(e,t){var n=new l.a;return fe(e).reduce((function(e,r){var i,o=t(r);if(void 0!==o){for(var a=r.length-1;a>=0;--a)(i={})[r[a]]=o,o=i;e=n.merge(e,o)}return e}),Object.create(null))}function fe(e){var t=se(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Object(j.a)(t)?(fe(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Object(j.a)(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function he(e,t){return e[t]}function pe(e,t,n){return n=n||he,de(t.reduce((function e(t,r){return Object(j.a)(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function de(e){return Object(E.a)(e)?Object(j.a)(e)?e.map(de):le(Object.keys(e).sort(),(function(t){return pe(e,t)})):e}function me(e){return void 0!==e.args?e.args:e.field?Object(O.a)(e.field,e.variables):null}var ve=function(){},ge=function(e,t){return t.fieldName},ye=function(e,t,n){return(0,n.mergeObjects)(e,t)},be=function(e,t){return t},Oe=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=Object(r.__assign)({dataIdFromObject:R},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,i=this,o=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var a,s=t&&t.storeObject||e,u=Object(r.__assign)(Object(r.__assign)({},t),{typename:o,storeObject:s,readField:t&&t.readField||function(){var e=xe(arguments,s);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),c=o&&this.getTypePolicy(o),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(Object(r.__assign)(Object(r.__assign)({},e),s),u);if(!Object(j.a)(f)){a=f;break}l=ue(f)}return a=a?String(a):void 0,u.keyObject?[a,u.keyObject]:[a]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var i=e[n],o=i.queryType,a=i.mutationType,s=i.subscriptionType,u=Object(r.__rest)(i,["queryType","mutationType","subscriptionType"]);o&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),C.call(t.toBeAdded,n)?t.toBeAdded[n].push(u):t.toBeAdded[n]=[u]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?ye:!1===t?be:e.merge}a(r,t.merge),r.keyFn=!1===i?ve:Object(j.a)(i)?ue(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;r.keyFn=!1===s?ge:Object(j.a)(s)?ce(s):"function"==typeof s?s:r.keyFn,"function"==typeof u&&(r.read=u),a(r,c)}r.read&&r.merge&&(r.keyFn=r.keyFn||ge)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(Object(i.c)(!r||r===e,5,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(I);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!C.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((function(n,r){if(n.test(e)){var o=t.supertypeMap.get(r);o&&o.forEach((function(e){return i.add(e)}))}}))),i&&i.size&&i.forEach((function(e){var i=t.getTypePolicy(e),o=i.fields,a=Object(r.__rest)(i,["fields"]);Object.assign(n,a),Object.assign(n.fields,o)}))}var o=this.toBeAdded[e];return o&&o.length&&o.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var o=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var s=this.getSupertypeSet(t,!0),u=[s],c=function(e){var t=o.getSupertypeSet(e,!1);t&&t.size&&u.indexOf(t)<0&&u.push(t)},l=!(!n||!this.fuzzySubtypes.size),f=!1,h=0;h1?s:t}:(o=Object(r.__assign)({},a),C.call(o,"from")||(o.from=t)),!1!==globalThis.__DEV__&&void 0===o.from&&!1!==globalThis.__DEV__&&i.c.warn(7,Object(ie.a)(Array.from(e))),void 0===o.variables&&(o.variables=n),o}function ke(e){return function(t,n){if(Object(j.a)(t)||Object(j.a)(n))throw Object(i.e)(8);if(Object(E.a)(t)&&Object(E.a)(n)){var o=e.getFieldValue(t,"__typename"),a=e.getFieldValue(n,"__typename");if(o&&a&&o!==a)return n;if(Object(O.g)(t)&&N(n))return e.merge(t.__ref,n),t;if(N(t)&&Object(O.g)(n))return e.merge(t,n.__ref),n;if(N(t)&&N(n))return Object(r.__assign)(Object(r.__assign)({},t),n)}return n}}function Se(e,t,n){var i="".concat(t).concat(n),o=e.flavors.get(i);return o||e.flavors.set(i,o=e.clientOnly===t&&e.deferred===n?e:Object(r.__assign)(Object(r.__assign)({},e),{clientOnly:t,deferred:n})),o}var _e=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,o=t.query,s=t.result,u=t.dataId,c=t.variables,f=t.overwrite,h=Object(S.f)(o),p=new l.a;c=Object(r.__assign)(Object(r.__assign)({},Object(S.b)(h)),c);var d=Object(r.__assign)(Object(r.__assign)({store:e,written:Object.create(null),merge:function(e,t){return p.merge(e,t)},variables:c,varString:Object(y.a)(c)},F(o,this.fragments)),{overwrite:!!f,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),m=this.processSelectionSet({result:s||Object.create(null),dataId:u,selectionSet:h.selectionSet,mergeTree:{map:new Map},context:d});if(!Object(O.g)(m))throw Object(i.e)(11,s);return d.incomingById.forEach((function(t,o){var s=t.storeObject,u=t.mergeTree,c=t.fieldNodeSet,l=Object(O.h)(o);if(u&&u.map.size){var f=n.applyMerges(u,l,s,d);if(Object(O.g)(f))return;s=f}if(!1!==globalThis.__DEV__&&!d.overwrite){var h=Object.create(null);c.forEach((function(e){e.selectionSet&&(h[e.name.value]=!0)}));Object.keys(s).forEach((function(e){(function(e){return!0===h[M(e)]})(e)&&!function(e){var t=u&&u.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,o){var s=function(e){var t=o.getFieldValue(e,n);return"object"==typeof t&&t},u=s(e);if(!u)return;var c=s(t);if(!c)return;if(Object(O.g)(u))return;if(Object(a.b)(u,c))return;if(Object.keys(u).every((function(e){return void 0!==o.getFieldValue(c,e)})))return;var l=o.getFieldValue(e,"__typename")||o.getFieldValue(t,"__typename"),f=M(n),h="".concat(l,".").concat(f);if(Ae.has(h))return;Ae.add(h);var p=[];Object(j.a)(u)||Object(j.a)(c)||[u,c].forEach((function(e){var t=o.getFieldValue(e,"__typename");"string"!=typeof t||p.includes(t)||p.push(t)}));!1!==globalThis.__DEV__&&i.c.warn(14,f,l,p.length?"either ensure all objects of type "+p.join(" and ")+" have an ID or a custom merge function, or ":"",h,Object(r.__assign)({},u),Object(r.__assign)({},c))}(l,s,e,d.store)}))}e.merge(o,s)})),e.retain(m.__ref),m},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,o=e.result,a=e.selectionSet,s=e.context,u=e.mergeTree,c=this.cache.policies,l=Object.create(null),f=n&&c.rootTypenamesById[n]||Object(O.c)(o,a,s.fragmentMap)||n&&s.store.get(n,"__typename");"string"==typeof f&&(l.__typename=f);var h=function(){var e=xe(arguments,l,s.variables);if(Object(O.g)(e.from)){var t=s.incomingById.get(e.from.__ref);if(t){var n=c.readField(Object(r.__assign)(Object(r.__assign)({},e),{from:t.storeObject}),s);if(void 0!==n)return n}}return c.readField(e,s)},p=new Set;this.flattenFields(a,o,s,f).forEach((function(e,n){var r,a=Object(O.i)(n),s=o[a];if(p.add(n),void 0!==s){var d=c.getStoreFieldName({typename:f,fieldName:n.name.value,field:n,variables:e.variables}),m=Ee(u,d),v=t.processFieldValue(s,n,n.selectionSet?Se(e,!1,!1):e,m),y=void 0;n.selectionSet&&(Object(O.g)(v)||N(v))&&(y=h("__typename",v));var b=c.getMergeFunction(f,n.name.value,y);b?m.info={field:n,typename:f,merge:b}:Ce(u,d),l=e.merge(l,((r={})[d]=v,r))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||g.a.added(n)||c.getReadFunction(f,n.name.value)||!1!==globalThis.__DEV__&&i.c.error(12,Object(O.i)(n),o)}));try{var d=c.identify(o,{typename:f,selectionSet:a,fragmentMap:s.fragmentMap,storeObject:l,readField:h}),m=d[0],v=d[1];n=n||m,v&&(l=s.merge(l,v))}catch(e){if(!n)throw e}if("string"==typeof n){var y=Object(O.h)(n),b=s.written[n]||(s.written[n]=[]);if(b.indexOf(a)>=0)return y;if(b.push(a),this.reader&&this.reader.isFresh(o,y,a,s))return y;var w=s.incomingById.get(n);return w?(w.storeObject=s.merge(w.storeObject,l),w.mergeTree=Te(w.mergeTree,u),p.forEach((function(e){return w.fieldNodeSet.add(e)}))):s.incomingById.set(n,{storeObject:l,mergeTree:je(u)?void 0:u,fieldNodeSet:p}),y}return l},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Object(j.a)(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,Ee(r,o));return Ce(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):!1!==globalThis.__DEV__?Object(re.a)(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=Object(O.c)(t,e,n.fragmentMap));var o=new Map,a=this.cache.policies,u=new T.a(!1);return function e(c,l){var f=u.lookup(c,l.clientOnly,l.deferred);f.visited||(f.visited=!0,c.selections.forEach((function(u){if(Object(_.g)(u,n.variables)){var c=l.clientOnly,f=l.deferred;if(c&&f||!Object(j.b)(u.directives)||u.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(c=!0),"defer"===t){var r=Object(O.a)(e,n.variables);r&&!1===r.if||(f=!0)}})),Object(O.e)(u)){var h=o.get(u);h&&(c=c&&h.clientOnly,f=f&&h.deferred),o.set(u,Se(n,c,f))}else{var p=Object(s.b)(u,n.lookupFragment);if(!p&&u.kind===w.a.FRAGMENT_SPREAD)throw Object(i.e)(13,u.name.value);p&&a.fragmentMatches(p,r,t,n.variables)&&e(p.selectionSet,Se(n,c,f))}}})))}(e,n),o},e.prototype.applyMerges=function(e,t,n,o,a){var s,u=this;if(e.map.size&&!Object(O.g)(n)){var c,l=Object(j.a)(n)||!Object(O.g)(t)&&!N(t)?void 0:t,f=n;l&&!a&&(a=[Object(O.g)(l)?l.__ref:l]);var h=function(e,t){return Object(j.a)(e)?"number"==typeof t?e[t]:void 0:o.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=h(l,t),r=h(f,t);if(void 0!==r){a&&a.push(t);var s=u.applyMerges(e,n,r,o,a);s!==r&&(c=c||new Map).set(t,s),a&&Object(i.c)(a.pop()===t)}})),c&&(n=Object(j.a)(f)?f.slice(0):Object(r.__assign)({},f),c.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,o,a&&(s=o.store).getStorage.apply(s,a)):n},e}(),Pe=[];function Ee(e,t){var n=e.map;return n.has(t)||n.set(t,Pe.pop()||{map:new Map}),n.get(t)}function Te(e,t){if(e===t||!t||je(t))return e;if(!e||je(e))return t;var n=e.info&&t.info?Object(r.__assign)(Object(r.__assign)({},e.info),t.info):e.info||t.info,i=e.map.size&&t.map.size,o={info:n,map:i?new Map:e.map.size?e.map:t.map};if(i){var a=new Set(t.map.keys());e.map.forEach((function(e,n){o.map.set(n,Te(e,t.map.get(n))),a.delete(n)})),a.forEach((function(n){o.map.set(n,Te(t.map.get(n),e.map.get(n)))}))}return o}function je(e){return!e||!(e.info||e.map.size)}function Ce(e,t){var n=e.map,r=n.get(t);r&&je(r)&&(Pe.push(r),n.delete(t))}var Ae=new Set;var Re=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new v.a(g.a),n.assumeImmutableResults=!0,n.makeVar=oe.c,n.txCount=0,n.config=function(e){return Object(k.a)($,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new Oe({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return Object(r.__extends)(t,e),t.prototype.init=function(){var e=this.data=new Z.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new _e(this,this.storeReader=new te({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Q(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=Object(o.c)((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize||u.a["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(K(n)){var r=e.optimistic,i=e.id,o=e.variables;return n.makeCacheKey(e.query,e.callback,Object(y.a)({optimistic:r,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(Object(r.__assign)(Object(r.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof m)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(C.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(Object(r.__assign)(Object(r.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||Object(oe.d)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&Object(oe.b)(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;y.a.reset(),b.a.reset(),this.addTypenameTransform.resetCache(),null===(t=this.config.fragments)||void 0===t||t.resetCaches();var n=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),n},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(Object(O.g)(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&i.c.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(C.call(e,"id"))return!1;e=Object(r.__assign)(Object(r.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),y.a.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Object(oe.b)(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,i=e.update,o=e.optimistic,a=void 0===o||o,s=e.removeOptimistic,u=e.onWatchUpdated,c=function(e){var r=n,o=r.data,a=r.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=i(n)}finally{--n.txCount,n.data=o,n.optimisticData=a}},l=new Set;return u&&!this.txCount&&this.broadcastWatches(Object(r.__assign)(Object(r.__assign)({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,c):!1===a?c(this.data):c(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&l.size?(this.broadcastWatches(Object(r.__assign)(Object(r.__assign)({},e),{onWatchUpdated:function(e,t){var n=u.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&Object(a.b)(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(d);!1!==globalThis.__DEV__&&(Re.prototype.getMemoryInternals=h.c)},1096:function(e,t,n){"use strict";n.d(t,"a",(function(){return me}));var r=n(10),i=n(18),o=n(166),a=n(878),s=n(769),u=n(411),c=n(571),l=n(772),f=n(889),h=n(824),p=n(888),d=n(816);var m=n(1093),v=n(890),g=n(349),y=n(86),b=Object(i.d)((function(){return fetch})),O=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,a=e.fetch,s=e.print,O=void 0===s?d.a:s,w=e.includeExtensions,x=e.preserveHeaderCase,k=e.useGETForQueries,S=e.includeUnusedVariables,_=void 0!==S&&S,P=Object(r.__rest)(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&Object(p.a)(a||b);var E={http:{includeExtensions:w,preserveHeaderCase:x},options:P.fetchOptions,credentials:P.credentials,headers:P.headers};return new o.a((function(e){var t=Object(f.a)(e,n),o=e.getContext(),s={};if(o.clientAwareness){var p=o.clientAwareness,w=p.name,x=p.version;w&&(s["apollographql-client-name"]=w),x&&(s["apollographql-client-version"]=x)}var S=Object(r.__assign)(Object(r.__assign)({},s),o.headers),P={http:o.http,options:o.fetchOptions,credentials:o.credentials,headers:S};if(Object(u.f)(["client"],e.query)){var T=Object(g.d)(e.query);if(!T)return Object(m.a)(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=T}var j,C=Object(d.c)(e,O,d.b,E,P),A=C.options,R=C.body;R.variables&&!_&&(R.variables=Object(v.a)(R.variables,e.query)),A.signal||"undefined"==typeof AbortController||(j=new AbortController,A.signal=j.signal);var $,Q="OperationDefinition"===($=Object(y.e)(e.query)).kind&&"subscription"===$.operation,I=Object(u.f)(["defer"],e.query);if(k&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(A.method="GET"),I||Q){A.headers=A.headers||{};var M="multipart/mixed;";Q&&I&&!1!==globalThis.__DEV__&&i.c.warn(39),Q?M+="boundary=graphql;subscriptionSpec=1.0,application/json":I&&(M+="deferSpec=20220824,application/json"),A.headers.accept=M}if("GET"===A.method){var D=function(e,t){var n=[],r=function(e,t){n.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var i=void 0;try{i=Object(l.a)(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=Object(l.a)(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+n.join("&")+a}}(t,R),N=D.newURI,F=D.parseError;if(F)return Object(m.a)(F);t=N}else try{A.body=Object(l.a)(R,"Payload")}catch(F){return Object(m.a)(F)}return new c.a((function(n){var r=a||Object(i.d)((function(){return fetch}))||b,o=n.next.bind(n);return r(t,A).then((function(t){var n;e.setContext({response:t});var r=null===(n=t.headers)||void 0===n?void 0:n.get("content-type");return null!==r&&/^multipart\/mixed/i.test(r)?Object(h.c)(t,o):Object(h.b)(e)(t).then(o)})).then((function(){j=void 0,n.complete()})).catch((function(e){j=void 0,Object(h.a)(e,n)})),function(){j&&j.abort()}}))}))},w=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,O(t).request)||this;return n.options=t,n}return Object(r.__extends)(t,e),t}(o.a),x=n(42),k=n(489),S=n(785),_=n(874),P=n(875),E=n(877),T=n(354),j=n(117),C=n(151),A=n(784),R=n(876),$=n(110),Q=n(60),I=n(616),M=n(839),D=n(577),N=n(786),F=n(793),L=Object.assign,q=Object.hasOwnProperty,z=function(e){function t(t){var n=t.queryManager,i=t.queryInfo,o=t.options,a=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=B)}catch(e){}var n=!a.observers.size;a.observers.add(e);var r=a.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&a.reobserve().catch((function(){})),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}}))||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=i,a.queryManager=n,a.waitForOwnResult=V(o.fetchPolicy),a.isTornDown=!1,a.subscribeToMore=a.subscribeToMore.bind(a);var s=n.defaultOptions.watchQuery,u=(void 0===s?{}:s).fetchPolicy,c=void 0===u?"cache-first":u,l=o.fetchPolicy,f=void 0===l?c:l,h=o.initialFetchPolicy,p=void 0===h?"standby"===f?c:f:h;a.options=Object(r.__assign)(Object(r.__assign)({},o),{initialFetchPolicy:p,fetchPolicy:f}),a.queryId=i.queryId||n.generateQueryId();var d=Object(y.f)(a.query);return a.queryName=d&&d.name&&d.name.value,a}return Object(r.__extends)(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||Q.a.ready,i=Object(r.__assign)(Object(r.__assign)({},t),{loading:Object(Q.b)(n),networkStatus:n}),o=this.options.fetchPolicy,a=void 0===o?"cache-first":o;if(V(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(i.data=s.result),Object(x.b)(i.data,{})&&(i.data=void 0),s.complete?(delete i.partial,!s.complete||i.networkStatus!==Q.a.loading||"cache-first"!==a&&"cache-only"!==a||(i.networkStatus=Q.a.ready,i.loading=!1)):i.partial=!0,!1===globalThis.__DEV__||s.complete||this.options.partialRefetch||i.loading||i.data||i.error||Z(s.missing)}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Object(F.a)(this.query,this.last.result,e,this.variables):!Object(x.b)(this.last.result,e))||t&&!Object(x.b)(this.last.variables,t))},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||Object(x.b)(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},o=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===o?o:"no-cache"===o?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&q.call(e,"variables")){var a=Object(y.h)(this.query),s=a.variableDefinitions;s&&s.some((function(e){return"variables"===e.variable.name.value}))||!1!==globalThis.__DEV__&&i.c.warn(20,e,(null===(t=a.name)||void 0===t?void 0:t.value)||a)}return e&&!Object(x.b)(this.options.variables,e)&&(n.variables=this.options.variables=Object(r.__assign)(Object(r.__assign)({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Q.a.refetch)},t.prototype.fetchMore=function(e){var t=this,n=Object(r.__assign)(Object(r.__assign)({},e.query?e:Object(r.__assign)(Object(r.__assign)(Object(r.__assign)(Object(r.__assign)({},this.options),{query:this.options.query}),e),{variables:Object(r.__assign)(Object(r.__assign)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});n.query=this.transformDocument(n.query);var o=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):n.query;var a=this.queryInfo,s=a.networkStatus;a.networkStatus=Q.a.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var u=new Set,c=null==e?void 0:e.updateQuery,l="no-cache"!==this.options.fetchPolicy;return l||Object(i.c)(c,21),this.queryManager.fetchQuery(o,n,Q.a.fetchMore).then((function(i){if(t.queryManager.removeQuery(o),a.networkStatus===Q.a.fetchMore&&(a.networkStatus=s),l)t.queryManager.cache.batch({update:function(r){var o=e.updateQuery;o?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return o(e,{fetchMoreResult:i.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:i.data})},onWatchUpdated:function(e){u.add(e.query)}});else{var f=t.getLast("result"),h=c(f.data,{fetchMoreResult:i.data,variables:n.variables});t.reportResult(Object(r.__assign)(Object(r.__assign)({},f),{data:h}),t.variables)}return i})).finally((function(){l&&!u.has(t.query)&&U(t)}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&i.c.error(22,t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=Object(I.a)(this.options,e||{});L(this.options,t)},t.prototype.setVariables=function(e){return Object(x.b)(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Q.a.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=void 0===n?"cache-first":n,i=t.initialFetchPolicy,o=void 0===i?r:i;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,n)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n&&this.hasObservers()){if(!t||t.interval!==n){Object(i.c)(n,23),(t||(this.pollingInfo={})).interval=n;var r=function(){var t,n;e.pollingInfo&&(Object(Q.b)(e.queryInfo.networkStatus)||(null===(n=(t=e.options).skipPollAttempt)||void 0===n?void 0:n.call(t))?o():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Q.a.poll).then(o,o))},o=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};o()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){void 0===t&&(t=this.variables);var n=this.getLastError();return n&&this.last&&!Object(x.b)(t,this.last.variables)&&(n=void 0),this.last=Object(r.__assign)({result:this.queryManager.assumeImmutableResults?e:Object(M.a)(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var i=t===Q.a.refetch||t===Q.a.fetchMore||t===Q.a.poll,o=this.options.variables,a=this.options.fetchPolicy,s=Object(I.a)(this.options,e||{}),u=i?s:L(this.options,s),c=this.transformDocument(u.query);this.lastQuery=c,i||(this.updatePolling(),!e||!e.variables||Object(x.b)(e.variables,o)||"standby"===u.fetchPolicy||u.fetchPolicy!==a&&"function"!=typeof u.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",u),void 0===t&&(t=Q.a.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=V(u.fetchPolicy));var l=function(){n.concast===p&&(n.waitForOwnResult=!1)},f=u.variables&&Object(r.__assign)({},u.variables),h=this.fetch(u,t,c),p=h.concast,d=h.fromLink,m={next:function(e){Object(x.b)(n.variables,f)&&(l(),n.reportResult(e,f))},error:function(e){Object(x.b)(n.variables,f)&&(Object($.d)(e)||(e=new $.a({networkError:e})),l(),n.reportError(e,f))}};return i||!d&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=m),p.addObserver(m),p},t.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},t.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t}(c.a);function U(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,t){return this.nextFetchPolicy=r,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,t):n}}):e.reobserve()}function B(e){!1!==globalThis.__DEV__&&i.c.error(24,e.message,e.stack)}function Z(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&i.c.debug(25,e)}function V(e){return"network-only"===e||"no-cache"===e||"standby"===e}Object(N.a)(z);var W=n(501),X=new(n(393).e?WeakMap:Map);function Y(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return X.set(e,(X.get(e)+1)%1e15),n.apply(this,arguments)})}function G(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var H=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;X.has(n)||(X.set(n,0),Y(n,"evict"),Y(n,"modify"),Y(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Q.a.loading;return this.variables&&this.networkStatus!==Q.a.loading&&!Object(x.b)(this.variables,e.variables)&&(t=Q.a.setVariables),Object(x.b)(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){G(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Object(x.b)(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,n=this,r=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(null===(t=this.observableQuery)||void 0===t?void 0:t.getLastError())||(this.updateLastDiff(e),this.dirty||Object(x.b)(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return n.notify()}),0))))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():U(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;G(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Object(Q.b)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var i=Object(r.__assign)(Object(r.__assign)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&Object(x.b)(i,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===X.get(this.cache)&&Object(x.b)(t,n.variables)&&Object(x.b)(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,o=new W.a,a=Object(T.b)(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Object(T.b)(e.incremental)){var s=Object(k.e)(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&(K(e,n.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,n.variables))o.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:X.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var a=i.getDiffOptions(n.variables),s=o.diff(a);!i.stopped&&Object(x.b)(i.variables,n.variables)&&i.updateWatch(n.variables),i.updateLastDiff(s,a),s.complete&&(e.data=s.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Q.a.ready},e.prototype.markError=function(e){return this.networkStatus=Q.a.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function K(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Object(E.b)(e);return!r&&n&&e.data&&(r=!0),r}var J=n(771),ee=n(356),te=n(861),ne=n(588),re=Object.prototype.hasOwnProperty,ie=Object.create(null),oe=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new te.b(ne.a["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new ee.a(!1);var n=new _.a((function(e){return t.cache.transformDocument(e)}),{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var r=e.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(Object(i.e)(26))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return Object(r.__awaiter)(this,arguments,void 0,(function(e){var t,n,o,a,s,u,c,l=e.mutation,f=e.variables,h=e.optimisticResponse,p=e.updateQueries,d=e.refetchQueries,m=void 0===d?[]:d,v=e.awaitRefetchQueries,g=void 0!==v&&v,y=e.update,b=e.onQueryUpdated,O=e.fetchPolicy,w=void 0===O?(null===(u=this.defaultOptions.mutate)||void 0===u?void 0:u.fetchPolicy)||"network-only":O,x=e.errorPolicy,k=void 0===x?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":x,S=e.keepRootFields,_=e.context;return Object(r.__generator)(this,(function(e){switch(e.label){case 0:return Object(i.c)(l,27),Object(i.c)("network-only"===w||"no-cache"===w,28),t=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),n=this.getDocumentInfo(l).hasClientExports,f=this.getVariables(l,f),n?[4,this.localState.addExportedVariables(l,f,_)]:[3,2];case 1:f=e.sent(),e.label=2;case 2:return o=this.mutationStore&&(this.mutationStore[t]={mutation:l,variables:f,loading:!0,error:null}),a=h&&this.markMutationOptimistic(h,{mutationId:t,document:l,variables:f,fetchPolicy:w,errorPolicy:k,context:_,updateQueries:p,update:y,keepRootFields:S}),this.broadcastQueries(),s=this,[2,new Promise((function(e,n){return Object(P.a)(s.getObservableFromLink(l,Object(r.__assign)(Object(r.__assign)({},_),{optimisticResponse:a?h:void 0}),f,{},!1),(function(e){if(Object(E.b)(e)&&"none"===k)throw new $.a({graphQLErrors:Object(E.a)(e)});o&&(o.loading=!1,o.error=null);var n=Object(r.__assign)({},e);return"function"==typeof m&&(m=m(n)),"ignore"===k&&Object(E.b)(n)&&delete n.errors,s.markMutationResult({mutationId:t,result:n,document:l,variables:f,fetchPolicy:w,errorPolicy:k,context:_,update:y,updateQueries:p,awaitRefetchQueries:g,refetchQueries:m,removeOptimistic:a?t:void 0,onQueryUpdated:b,keepRootFields:S})})).subscribe({next:function(t){s.broadcastQueries(),"hasNext"in t&&!1!==t.hasNext||e(t)},error:function(e){o&&(o.loading=!1,o.error=e),a&&s.cache.removeOptimistic(t),s.broadcastQueries(),n(e instanceof $.a?e:new $.a({networkError:e}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var i=e.result,o=[],a="no-cache"===e.fetchPolicy;if(!a&&K(i,e.errorPolicy)){if(Object(k.b)(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Object(k.b)(i)&&Object(T.b)(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Object(k.e)(s.result,i)),void 0!==u&&(i.data=u,o.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach((function(e,r){var a=e.observableQuery,s=a&&a.queryName;if(s&&re.call(c,s)){var u=c[s],l=n.queries.get(r),f=l.document,h=l.variables,p=t.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),d=p.result;if(p.complete&&d){var m=u(d,{mutationResult:i,queryName:f&&Object(y.g)(f)||void 0,queryVariables:h});m&&o.push({result:m,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(o.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){a||o.forEach((function(e){return t.write(e)}));var s=e.update,u=!Object(k.d)(i)||Object(k.b)(i)&&!i.hasNext;if(s){if(!a){var c=t.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});c.complete&&("incremental"in(i=Object(r.__assign)(Object(r.__assign)({},i),{data:c.result}))&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}u&&s(t,i,{context:e.context,variables:e.variables})}a||e.keepRootFields||!u||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then((function(){return i}))}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(e,t){var n=this,o="function"==typeof e?e(t.variables,{IGNORE:ie}):e;return o!==ie&&(this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(Object(r.__assign)(Object(r.__assign)({},t),{result:{data:o}}),e)}catch(e){!1!==globalThis.__DEV__&&i.c.error(e)}}),t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:Object(u.e)(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:Object(u.f)(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:Object(g.f)([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Object(y.b)(Object(y.f)(e)),asQuery:Object(r.__assign)(Object(r.__assign)({},e),{definitions:e.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?Object(r.__assign)(Object(r.__assign)({},e),{operation:"query"}):e}))})};t.set(e,n)}return t.get(e)},e.prototype.getVariables=function(e,t){return Object(r.__assign)(Object(r.__assign)({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=Object(r.__assign)(Object(r.__assign)({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=new H(this),i=new z({queryManager:this,queryInfo:n,options:e});return i.lastQuery=t,this.queries.set(i.queryId,n),n.init({document:t,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),Object(i.c)(e.query,29),Object(i.c)("Document"===e.query.kind,30),Object(i.c)(!e.returnPartialData,31),Object(i.c)(!e.pollInterval,32),this.fetchQuery(t,Object(r.__assign)(Object(r.__assign)({},e),{query:this.transform(e.query)})).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(Object(i.e)(33)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Q.a.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,o=new Map,a=new Set;return Array.isArray(e)&&e.forEach((function(e){"string"==typeof e?o.set(e,!1):Object(j.d)(e)?o.set(t.transform(e),!1):Object(C.a)(e)&&e.query&&a.add(e)})),this.queries.forEach((function(t,r){var i=t.observableQuery,a=t.document;if(i){if("all"===e)return void n.set(r,i);var s=i.queryName;if("standby"===i.options.fetchPolicy||"active"===e&&!i.hasObservers())return;("active"===e||s&&o.has(s)||a&&o.has(a))&&(n.set(r,i),s&&o.set(s,!0),a&&o.set(a,!0))}})),a.size&&a.forEach((function(e){var o=Object(A.a)("legacyOneTimeQuery"),a=t.getQuery(o).init({document:e.query,variables:e.variables}),s=new z({queryManager:t,queryInfo:a,options:Object(r.__assign)(Object(r.__assign)({},e),{fetchPolicy:"network-only"})});Object(i.c)(s.queryId===o),a.setObservableQuery(s),n.set(o,s)})),!1!==globalThis.__DEV__&&o.size&&o.forEach((function(e,t){e||!1!==globalThis.__DEV__&&i.c.warn("string"==typeof t?34:35,t)})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=void 0===i?"none":i,a=e.variables,s=e.context,u=void 0===s?{}:s,l=e.extensions,f=void 0===l?{}:l;n=this.transform(n),a=this.getVariables(n,a);var h=function(e){return t.getObservableFromLink(n,u,e,f).map((function(i){"no-cache"!==r&&(K(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var a=Object(E.b)(i),s=Object($.c)(i);if(a||s){var u={};if(a&&(u.graphQLErrors=i.errors),s&&(u.protocolErrors=i.extensions[$.b]),"none"===o||s)throw new $.a(u)}return"ignore"===o&&delete i.errors,i}))};if(this.getDocumentInfo(n).hasClientExports){var p=this.localState.addExportedVariables(n,a,u).then(h);return new c.a((function(e){var t=null;return p.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return h(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,i,o){var s,u,l=this;void 0===o&&(o=null!==(s=null==t?void 0:t.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var f=this.getDocumentInfo(e),h=f.serverQuery,p=f.clientQuery;if(h){var d=this.inFlightLinkObservables,m=this.link,v={query:h,variables:n,operationName:Object(y.g)(h)||void 0,context:this.prepareContext(Object(r.__assign)(Object(r.__assign)({},t),{forceFetch:!o})),extensions:i};if(t=v.context,o){var g=Object(J.a)(h),b=Object(S.a)(n),O=d.lookup(g,b);if(!(u=O.observable)){var w=new R.a([Object(a.a)(m,v)]);u=O.observable=w,w.beforeNext((function(){d.remove(g,b)}))}}else u=new R.a([Object(a.a)(m,v)])}else u=new R.a([c.a.of({data:{}})]),t=this.prepareContext(t);return p&&(u=Object(P.a)(u,(function(e){return l.localState.runResolvers({document:p,remoteResult:e,context:t,variables:n})}))),u},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(n.query);return Object(P.a)(this.getObservableFromLink(i,n.context,n.variables),(function(o){var a=Object(E.a)(o),s=a.length>0,u=n.errorPolicy;if(r>=e.lastRequestId){if(s&&"none"===u)throw e.markError(new $.a({graphQLErrors:a}));e.markResult(o,i,n,t),e.markReady()}var c={data:o.data,loading:!1,networkStatus:Q.a.ready};return s&&"none"===u&&(c.data=void 0),s&&"ignore"!==u&&(c.errors=a,c.networkStatus=Q.a.error),c}),(function(t){var n=Object($.d)(t)?t:new $.a({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchConcastWithInfo=function(e,t,n,r){var i=this;void 0===n&&(n=Q.a.loading),void 0===r&&(r=t.query);var o,a,s=this.getVariables(r,t.variables),u=this.getQuery(e),c=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?c&&c.fetchPolicy||"cache-first":l,h=t.errorPolicy,p=void 0===h?c&&c.errorPolicy||"none":h,d=t.returnPartialData,m=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,y=t.context,b=void 0===y?{}:y,O=Object.assign({},t,{query:r,variables:s,fetchPolicy:f,errorPolicy:p,returnPartialData:m,notifyOnNetworkStatusChange:g,context:b}),w=function(e){O.variables=e;var r=i.fetchQueryByPolicy(u,O,n);return"standby"!==O.fetchPolicy&&r.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",t),r},x=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){x(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(O.query).hasClientExports)o=new R.a(this.localState.addExportedVariables(O.query,O.variables,O.context).then(w).then((function(e){return e.sources}))),a=!0;else{var k=w(O.variables);a=k.fromLink,o=new R.a(k.sources)}return o.promise.then(x,x),{concast:o,fromLink:a}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?Object(A.a)("refetchQueries"):void 0:a,u=e.onQueryUpdated,c=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){c.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var l=new Map;return n&&this.cache.batch({update:n,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof H&&e.watcher.observableQuery;if(r){if(u){c.delete(r.queryId);var i=u(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==u&&c.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),c.size&&c.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,a=e.diff;if(u){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}r=u(i,a,o)}u&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,o=t.query,a=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,l=t.errorPolicy,f=t.returnPartialData,h=t.context,p=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:o,variables:a,networkStatus:n});var m=function(){return e.getDiff()},v=function(t,n){void 0===n&&(n=e.networkStatus||Q.a.loading);var s=t.result;!1===globalThis.__DEV__||f||Object(x.b)(s,{})||Z(t.missing);var u=function(e){return c.a.of(Object(r.__assign)({data:e,loading:Object(Q.b)(n),networkStatus:n},t.complete?null:{partial:!0}))};return s&&i.getDocumentInfo(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:s},context:h,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return u(e.data||void 0)})):"none"===l&&n===Q.a.refetch&&Array.isArray(t.missing)?u(void 0):u(s)},g="no-cache"===s?0:n===Q.a.refetch&&"merge"!==u?1:2,y=function(){return i.getResultsFromLink(e,g,{query:o,variables:a,context:h,fetchPolicy:s,errorPolicy:l})},b=p&&"number"==typeof d&&d!==n&&Object(Q.b)(n);switch(s){default:case"cache-first":return(O=m()).complete?{fromLink:!1,sources:[v(O,e.markReady())]}:f||b?{fromLink:!0,sources:[v(O),y()]}:{fromLink:!0,sources:[y()]};case"cache-and-network":var O;return(O=m()).complete||f||b?{fromLink:!0,sources:[v(O),y()]}:{fromLink:!0,sources:[y()]};case"cache-only":return{fromLink:!1,sources:[v(m(),e.markReady())]};case"network-only":return b?{fromLink:!0,sources:[v(m()),y()]}:{fromLink:!0,sources:[y()]};case"no-cache":return b?{fromLink:!0,sources:[v(e.getDiff()),y()]}:{fromLink:!0,sources:[y()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new H(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Object(r.__assign)(Object(r.__assign)(Object(r.__assign)({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),ae=n(243),se=n(36);function ue(e){return e.kind===se.a.FIELD||e.kind===se.a.FRAGMENT_SPREAD||e.kind===se.a.INLINE_FRAGMENT}var ce=n(388),le=n(565),fe=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Object(W.b)(t.resolvers,e)})):this.resolvers=Object(W.b)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return Object(r.__awaiter)(this,arguments,void 0,(function(e){var t=e.document,n=e.remoteResult,i=e.context,o=e.variables,a=e.onlyRunForcedResolvers,s=void 0!==a&&a;return Object(r.__generator)(this,(function(e){return t?[2,this.resolveDocument(t,n.data,i,o,this.fragmentMatcher,s).then((function(e){return Object(r.__assign)(Object(r.__assign)({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Object(u.f)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return Object(g.d)(e)},e.prototype.prepareContext=function(e){var t=this.cache;return Object(r.__assign)(Object(r.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return Object(r.__awaiter)(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Object(r.__generator)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Object(r.__assign)(Object(r.__assign)({},t),e.exportedVariables)}))]:[2,Object(r.__assign)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Object(ae.b)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return ae.a}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Object(g.b)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return Object(r.__awaiter)(this,arguments,void 0,(function(e,t,n,i,o,a){var s,u,c,l,f,h,p,d,m,v;return void 0===n&&(n={}),void 0===i&&(i={}),void 0===o&&(o=function(){return!0}),void 0===a&&(a=!1),Object(r.__generator)(this,(function(g){return s=Object(y.e)(e),u=Object(y.d)(e),c=Object(ce.a)(u),l=this.collectSelectionsToResolve(s,c),f=s.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(p=this).cache,m=p.client,v={fragmentMap:c,context:Object(r.__assign)(Object(r.__assign)({},n),{cache:d,client:m}),variables:i,fragmentMatcher:o,defaultOperationType:h,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:a},!1,[2,this.resolveSelectionSet(s.selectionSet,false,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n,o){return Object(r.__awaiter)(this,void 0,void 0,(function(){var a,s,c,l,f,h=this;return Object(r.__generator)(this,(function(p){return a=o.fragmentMap,s=o.context,c=o.variables,l=[n],f=function(e){return Object(r.__awaiter)(h,void 0,void 0,(function(){var f,h;return Object(r.__generator)(this,(function(r){return(t||o.selectionsToResolve.has(e))&&Object(u.g)(e,c)?Object(j.e)(e)?[2,this.resolveField(e,t,n,o).then((function(t){var n;void 0!==t&&l.push(((n={})[Object(j.i)(e)]=t,n))}))]:(Object(j.f)(e)?f=e:(f=a[e.name.value],Object(i.c)(f,18,e.name.value)),f&&f.typeCondition&&(h=f.typeCondition.name.value,o.fragmentMatcher(n,h,s))?[2,this.resolveSelectionSet(f.selectionSet,t,n,o).then((function(e){l.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(f)).then((function(){return Object(W.c)(l)}))]}))}))},e.prototype.resolveField=function(e,t,n,i){return Object(r.__awaiter)(this,void 0,void 0,(function(){var o,a,s,u,c,l,f,h,p,d=this;return Object(r.__generator)(this,(function(r){return n?(o=i.variables,a=e.name.value,s=Object(j.i)(e),u=a!==s,c=n[s]||n[a],l=Promise.resolve(c),i.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=n.__typename||i.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(p=h[u?a:s])&&(l=Promise.resolve(le.a.withValue(this.cache,p,[n,Object(j.a)(e,o),i.context,{field:e,fragmentMap:i.fragmentMap}])))),[2,l.then((function(n){var r,o;if(void 0===n&&(n=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(i.exportedVariables[e.value.value]=n)}))})),!e.selectionSet)return n;if(null==n)return n;var a=null!==(o=null===(r=e.directives)||void 0===r?void 0:r.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(n)?d.resolveSubSelectedArray(e,t||a,n,i):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t||a,n,i):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map((function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;return function e(o){if(!r.has(o)){var a=new Set;r.set(o,a),Object(ae.b)(o,{Directive:function(e,t,r,i,o){"client"===e.name.value&&o.forEach((function(e){n(e)&&ue(e)&&a.add(e)}))},FragmentSpread:function(r,o,s,u,c){var l=t[r.name.value];Object(i.c)(l,19,r.name.value);var f=e(l);f.size>0&&(c.forEach((function(e){n(e)&&ue(e)&&a.add(e)})),a.add(r),f.forEach((function(e){a.add(e)})))}})}return r.get(o)}(e)},e}(),he=n(837),pe=n(240),de=!1,me=function(){function e(e){var t,n=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Object(i.e)(15);var a=e.uri,u=e.credentials,c=e.headers,l=e.cache,f=e.documentTransform,h=e.ssrMode,p=void 0!==h&&h,d=e.ssrForceFetchDelay,m=void 0===d?0:d,v=e.connectToDevTools,g=e.queryDeduplication,y=void 0===g||g,b=e.defaultOptions,O=e.defaultContext,x=e.assumeImmutableResults,k=void 0===x?l.assumeImmutableResults:x,S=e.resolvers,_=e.typeDefs,P=e.fragmentMatcher,E=e.name,T=e.version,j=e.devtools,C=e.link;C||(C=a?new w({uri:a,credentials:u,headers:c}):o.a.empty()),this.link=C,this.cache=l,this.disableNetworkFetches=p||m>0,this.queryDeduplication=y,this.defaultOptions=b||Object.create(null),this.typeDefs=_,this.devtoolsConfig=Object(r.__assign)(Object(r.__assign)({},j),{enabled:null!==(t=null==j?void 0:j.enabled)&&void 0!==t?t:v}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),m&&setTimeout((function(){return n.disableNetworkFetches=!1}),m),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=s.a,this.localState=new fe({cache:l,client:this,resolvers:S,fragmentMatcher:P}),this.queryManager=new oe({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:O,documentTransform:f,queryDeduplication:y,ssrMode:p,clientAwareness:{name:E,version:T},localState:this.localState,assumeImmutableResults:k,onBroadcast:this.devtoolsConfig.enabled?function(){n.devToolsHookCb&&n.devToolsHookCb({action:{},state:{queries:n.queryManager.getQueryStore(),mutations:n.queryManager.mutationStore||{}},dataWithOptimisticResults:n.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if("undefined"!=typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,de||!1===globalThis.__DEV__||(de=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout((function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,n=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?n="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(n="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),n&&!1!==globalThis.__DEV__&&i.c.log("Download the Apollo DevTools for a better development experience: %s",n)}}),1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Object(he.a)(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Object(r.__assign)(Object(r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Object(he.a)(this.defaultOptions.query,e)),Object(i.c)("cache-and-network"!==e.fetchPolicy,16),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Object(r.__assign)(Object(r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Object(he.a)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Object(a.a)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var o=Promise.all(r);return o.queries=n,o.results=r,o.catch((function(e){!1!==globalThis.__DEV__&&i.c.debug(17,e)})),o},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(me.prototype.getMemoryInternals=pe.b)},1097:function(e,t,n){"use strict";var r=n(64),i=n(118),o=n(138);function a(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var s=n(0),u=n.n(s),c=n(75),l=n.n(c),f=!1,h=n(587),p=function(e){return e.scrollTop},d="unmounted",m="exited",v="entering",g="entered",y="exiting",b=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=m,r.appearStatus=v):i=g:i=t.unmountOnExit||t.mountOnEnter?d:m,r.state={status:i},r.nextCallback=null,r}Object(o.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===d?{status:m}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==v&&n!==g&&(t=v):n!==v&&n!==g||(t=y)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===v){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:l.a.findDOMNode(this);n&&p(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===m&&this.setState({status:d})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[l.a.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),u=r?s.appear:s.enter;!e&&!n||f?this.safeSetState({status:g},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:v},(function(){t.props.onEntering(o,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:g},(function(){t.props.onEntered(o,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:l.a.findDOMNode(this);t&&!f?(this.props.onExit(r),this.safeSetState({status:y},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:m},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:m},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:l.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===d)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(i.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return u.a.createElement(h.a.Provider,{value:null},"function"==typeof n?n(e,r):u.a.cloneElement(u.a.Children.only(n),r))},t}(u.a.Component);function O(){}b.contextType=h.a,b.propTypes={},b.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:O,onEntering:O,onEntered:O,onExit:O,onExiting:O,onExited:O},b.UNMOUNTED=d,b.EXITED=m,b.ENTERING=v,b.ENTERED=g,b.EXITING=y;var w=b,x=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=a(n.className,r):n.setAttribute("class",a(n.className&&n.className.baseVal||"",r)));var n,r}))},k=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase()}var c={};function l(e,t,n,r){var i,o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(e.length<16)throw new Error("Random bytes length must be >= 16");if(r){if(a<0||a+16>r.length)throw new RangeError("UUID byte range ".concat(a,":").concat(a+15," is out of buffer bounds"))}else r=new Uint8Array(16),a=0;return null!==(i=t)&&void 0!==i||(t=Date.now()),null!==(o=n)&&void 0!==o||(n=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9]),r[a++]=t/1099511627776&255,r[a++]=t/4294967296&255,r[a++]=t/16777216&255,r[a++]=t/65536&255,r[a++]=t/256&255,r[a++]=255&t,r[a++]=112|n>>>28&15,r[a++]=n>>>20&255,r[a++]=128|n>>>14&63,r[a++]=n>>>6&255,r[a++]=n<<2&255|3&e[10],r[a++]=e[11],r[a++]=e[12],r[a++]=e[13],r[a++]=e[14],r[a++]=e[15],r}t.a=function(e,t,n){var r;if(e){var i,a,s;r=l(null!==(i=null!==(a=e.random)&&void 0!==a?a:null===(s=e.rng)||void 0===s?void 0:s.call(e))&&void 0!==i?i:o(),e.msecs,e.seq,t,n)}else{var f=Date.now(),h=o();!function(e,t,n){var r,i;null!==(r=e.msecs)&&void 0!==r||(e.msecs=-1/0),null!==(i=e.seq)&&void 0!==i||(e.seq=0),t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(c,f,h),r=l(h,c.msecs,c.seq,t,n)}return t?r:u(r)}},1099:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),i=n(166),o=n(18),a=n(411),s=n(349),u=n(571),c=n(1093),l=n(816),f=n(888),h=n(889),p=n(772),d=n(824),m=function(){function e(e){var t=e.batchDebounce,n=e.batchInterval,r=e.batchMax,i=e.batchHandler,o=e.batchKey;this.batchesByKey=new Map,this.scheduledBatchTimerByKey=new Map,this.batchDebounce=t,this.batchInterval=n,this.batchMax=r||0,this.batchHandler=i,this.batchKey=o||function(){return""}}return e.prototype.enqueueRequest=function(e){var t=this,n=Object(r.__assign)(Object(r.__assign)({},e),{next:[],error:[],complete:[],subscribers:new Set}),i=this.batchKey(e.operation);return n.observable||(n.observable=new u.a((function(e){var r=t.batchesByKey.get(i);r||t.batchesByKey.set(i,r=new Set);var o=0===r.size,a=0===n.subscribers.size;return n.subscribers.add(e),a&&r.add(n),e.next&&n.next.push(e.next.bind(e)),e.error&&n.error.push(e.error.bind(e)),e.complete&&n.complete.push(e.complete.bind(e)),(o||t.batchDebounce)&&t.scheduleQueueConsumption(i),r.size===t.batchMax&&t.consumeQueue(i),function(){var o;n.subscribers.delete(e)&&n.subscribers.size<1&&r.delete(n)&&r.size<1&&(t.consumeQueue(i),null===(o=r.subscription)||void 0===o||o.unsubscribe())}}))),n.observable},e.prototype.consumeQueue=function(e){void 0===e&&(e="");var t=this.batchesByKey.get(e);if(this.batchesByKey.delete(e),t&&t.size){var n=[],r=[],i=[],o=[],a=[],s=[];t.forEach((function(e){n.push(e.operation),r.push(e.forward),i.push(e.observable),o.push(e.next),a.push(e.error),s.push(e.complete)}));var c=this.batchHandler(n,r)||u.a.of(),l=function(e){a.forEach((function(t){t&&t.forEach((function(t){return t(e)}))}))};return t.subscription=c.subscribe({next:function(e){if(Array.isArray(e)||(e=[e]),o.length!==e.length){var t=new Error("server returned results with length ".concat(e.length,", expected length of ").concat(o.length));return t.result=e,l(t)}e.forEach((function(e,t){o[t]&&o[t].forEach((function(t){return t(e)}))}))},error:l,complete:function(){s.forEach((function(e){e&&e.forEach((function(e){return e()}))}))}}),i}},e.prototype.scheduleQueueConsumption=function(e){var t=this;clearTimeout(this.scheduledBatchTimerByKey.get(e)),this.scheduledBatchTimerByKey.set(e,setTimeout((function(){t.consumeQueue(e),t.scheduledBatchTimerByKey.delete(e)}),this.batchInterval))},e}(),v=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.batchDebounce,o=r.batchInterval,a=void 0===o?10:o,s=r.batchMax,u=void 0===s?0:s,c=r.batchHandler,l=void 0===c?function(){return null}:c,f=r.batchKey,h=void 0===f?function(){return""}:f;return n.batcher=new m({batchDebounce:i,batchInterval:a,batchMax:u,batchHandler:l,batchKey:h}),t.batchHandler.length<=1&&(n.request=function(e){return n.batcher.enqueueRequest({operation:e})}),n}return Object(r.__extends)(t,e),t.prototype.request=function(e,t){return this.batcher.enqueueRequest({operation:e,forward:t})},t}(i.a),g=n(890),y=Object(o.d)((function(){return fetch})),b=function(e){function t(t){var n=e.call(this)||this,i=t||{},m=i.uri,b=void 0===m?"/graphql":m,O=i.fetch,w=i.print,x=void 0===w?l.a:w,k=i.includeExtensions,S=i.preserveHeaderCase,_=i.batchInterval,P=i.batchDebounce,E=i.batchMax,T=i.batchKey,j=i.includeUnusedVariables,C=void 0!==j&&j,A=Object(r.__rest)(i,["uri","fetch","print","includeExtensions","preserveHeaderCase","batchInterval","batchDebounce","batchMax","batchKey","includeUnusedVariables"]);!1!==globalThis.__DEV__&&Object(f.a)(O||y);var R={http:{includeExtensions:k,preserveHeaderCase:S},options:A.fetchOptions,credentials:A.credentials,headers:A.headers};n.batchDebounce=P,n.batchInterval=_||10,n.batchMax=E||10;return T=T||function(e){var t=e.getContext(),n={http:t.http,options:t.fetchOptions,credentials:t.credentials,headers:t.headers};return Object(h.a)(e,b)+JSON.stringify(n)},n.batcher=new v({batchDebounce:n.batchDebounce,batchInterval:n.batchInterval,batchMax:n.batchMax,batchKey:T,batchHandler:function(e){var t=Object(h.a)(e[0],b),n=e[0].getContext(),i={};if(n.clientAwareness){var f=n.clientAwareness,m=f.name,v=f.version;m&&(i["apollographql-client-name"]=m),v&&(i["apollographql-client-version"]=v)}var w={http:n.http,options:n.fetchOptions,credentials:n.credentials,headers:Object(r.__assign)(Object(r.__assign)({},i),n.headers)},k=e.map((function(e){var t=e.query;return Object(a.f)(["client"],t)?Object(s.d)(t):t}));if(k.some((function(e){return!e})))return Object(c.a)(new Error("BatchHttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or enable the `transformOptions.removeClientFields` option."));var S,_=e.map((function(e,t){var n=Object(l.c)(Object(r.__assign)(Object(r.__assign)({},e),{query:k[t]}),x,l.b,R,w);return n.body.variables&&!C&&(n.body.variables=Object(g.a)(n.body.variables,e.query)),n})),P=_.map((function(e){return e.body})),E=_[0].options;if("GET"===E.method)return Object(c.a)(new Error("apollo-link-batch-http does not support GET requests"));try{E.body=Object(p.a)(P,"Payload")}catch(e){return Object(c.a)(e)}return E.signal||"undefined"==typeof AbortController||(S=new AbortController,E.signal=S.signal),new u.a((function(n){return(O||Object(o.d)((function(){return fetch}))||y)(t,E).then((function(t){return e.forEach((function(e){return e.setContext({response:t})})),t})).then(Object(d.b)(e)).then((function(e){return S=void 0,n.next(e),n.complete(),e})).catch((function(e){S=void 0,e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e)})),function(){S&&S.abort()}}))}}),n}return Object(r.__extends)(t,e),t.prototype.request=function(e){return this.batcher.request(e)},t}(i.a)},11:function(e,t,n){"use strict";n.d(t,"a",(function(){return Ae})),n.d(t,"b",(function(){return Ue})),n.d(t,"c",(function(){return qr})),n.d(t,"d",(function(){return fo})),n.d(t,"e",(function(){return $t})),n.d(t,"f",(function(){return je})),n.d(t,"g",(function(){return Xi})),n.d(t,"h",(function(){return pi})),n.d(t,"i",(function(){return Si})),n.d(t,"j",(function(){return di})),n.d(t,"k",(function(){return ao})),n.d(t,"l",(function(){return io})),n.d(t,"m",(function(){return go})),n.d(t,"n",(function(){return Fi})),n.d(t,"o",(function(){return Mo})),n.d(t,"p",(function(){return Ri})),n.d(t,"q",(function(){return Gr})),n.d(t,"r",(function(){return Ro})),n.d(t,"s",(function(){return jt})),n.d(t,"t",(function(){return Zi})),n.d(t,"u",(function(){return Jr})),n.d(t,"v",(function(){return Ni})),n.d(t,"w",(function(){return lo})),n.d(t,"x",(function(){return ro}));for(var r=n(7),i=n(396),o={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),u="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),c=0;c<10;c++)o[48+c]=o[96+c]=String(c);for(c=1;c<=24;c++)o[c+111]="F"+c;for(c=65;c<=90;c++)o[c]=String.fromCharCode(c+32),a[c]=String.fromCharCode(c);for(var l in o)a.hasOwnProperty(l)||(a[l]=o[l]);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||x(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=p(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(this,arguments)}function p(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}function d(e,t,n){return t=g(t),function(e,t){if(t&&("object"===S(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}(e,v()?Reflect.construct(t,n||[],g(e).constructor):t.apply(e,n))}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function O(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||x(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=x(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function x(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}var q,z=function(){function e(){_(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return E(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"setRange",value:function(e){var t=e.anchorNode,n=e.focusNode;this.set(t,Math.min(e.anchorOffset,t?D(t):0),n,Math.min(e.focusOffset,n?D(n):0))}},{key:"set",value:function(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}]),e}(),U=null;function B(e){if(e.setActive)return e.setActive();if(U)return e.focus(U);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==U?{get preventScroll(){return U={preventScroll:!0},!0}}:void 0),!U){U=!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:t,r=q||(q=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function V(e,t,n,r){var i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&(i.altKey=r.altKey,i.ctrlKey=r.ctrlKey,i.shiftKey=r.shiftKey,i.metaKey=r.metaKey);var o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);var a=new KeyboardEvent("keyup",i);return a.synthetic=!0,e.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function W(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function X(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function Y(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function G(e,t){for(var n=e,r=t;;){if(3==n.nodeType&&r>0)return{node:n,offset:r};if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;r=D(n=n.childNodes[r-1])}else{if(!n.parentNode||I(n))return null;r=Q(n),n=n.parentNode}}}function H(e,t){for(var n=e,r=t;;){if(3==n.nodeType&&r2&&void 0!==arguments[2])||arguments[2];_(this,e),this.node=t,this.offset=n,this.precise=r}return E(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,Q(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,Q(t)+1,n)}}]),e}(),J=[],ee=function(){function e(){_(this,e),this.parent=null,this.dom=null,this.flags=2}return E(e,[{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=w(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i==e)return n;n+=i.length+i.breakAfter}}catch(e){r.e(e)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(e){return this.posBefore(e)+e.length}},{key:"sync",value:function(t,n){if(2&this.flags){var r,i,o=this.dom,a=null,s=w(this.children);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(7&u.flags){if(!u.dom&&(r=a?a.nextSibling:o.firstChild)){var c=e.get(r);(!c||!c.parent&&c.canReuseDOM(u))&&u.reuseDOM(r)}u.sync(t,n),u.flags&=-8}if(r=a?a.nextSibling:o.firstChild,n&&!n.written&&n.node==o&&r!=u.dom&&(n.written=!0),u.dom.parentNode==o)for(;r&&r!=u.dom;)r=te(r);else o.insertBefore(u.dom,r);a=u.dom}}catch(e){s.e(e)}finally{s.f()}for((r=a?a.nextSibling:o.firstChild)&&n&&n.node==o&&(n.written=!0);r;)r=te(r)}else if(1&this.flags){var l,f=w(this.children);try{for(f.s();!(l=f.n()).done;){var h=l.value;7&h.flags&&(h.sync(t,n),h.flags&=-8)}}catch(e){f.e(e)}finally{f.f()}}}},{key:"reuseDOM",value:function(e){}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==D(t)?0:0==n?-1:1;;){var o=t.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=t==o.firstChild?-1:1),t=o}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var u=this.children[a];if(u.dom==r)return s;s+=u.length+u.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,u=n,c=n;st)return l.domBoundsAround(e,t,u);if(f>=e&&-1==r&&(r=s,i=u),u>t&&l.dom.parentNode==this.dom){o=s,a=c;break}c=f,u=f+l.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}},{key:"markDirty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.flags|=2,this.markParentsDirty(e)}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new ne(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"isEditable",get:function(){return!0}},{key:"isWidget",get:function(){return!1}},{key:"isHidden",get:function(){return!1}},{key:"merge",value:function(e,t,n,r,i,o){return!1}},{key:"become",value:function(e){return!1}},{key:"canReuseDOM",value:function(e){return e.constructor==this.constructor&&!(8&(this.flags|e.flags))}},{key:"getSide",value:function(){return 0}},{key:"destroy",value:function(){var e,t=w(this.children);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.parent==this&&n.destroy()}}catch(e){t.e(e)}finally{t.f()}this.parent=null}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function te(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}ee.prototype.breakAfter=0;var ne=function(){function e(t,n,r){_(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return E(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}();function re(e,t,n,r,i,o,a,s,u){var c=e.children,l=c.length?c[t]:null,f=o.length?o[o.length-1]:null,h=f?f.breakAfter:a;if(!(t==r&&l&&!a&&!h&&o.length<2&&l.merge(n,i,o.length?f:null,0==n,s,u))){if(r0&&(!a&&o.length&&l.merge(n,l.length,o[0],!1,s,0)?l.breakAfter=o.shift().breakAfter:(n2),ve={mac:me||/Mac/.test(oe.platform),windows:/Win/.test(oe.platform),linux:/Linux|X11/.test(oe.platform),ie:le,ie_version:ue?ae.documentMode||6:ce?+ce[1]:se?+se[1]:0,gecko:fe,gecko_version:fe?+(/Firefox\/(\d+)/.exec(oe.userAgent)||[0,0])[1]:0,chrome:!!he,chrome_version:he?+he[1]:0,ios:me,android:/Android\b/.test(oe.userAgent),webkit:pe,safari:de,webkit_version:pe?+(/\bAppleWebKit\/(\d+)/.exec(oe.userAgent)||[0,0])[1]:0,tabSize:null!=ae.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},ge=function(e){function t(e){var n;return _(this,t),(n=d(this,t)).text=e,n}return y(t,e),E(t,[{key:"length",get:function(){return this.text.length}},{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){3==e.nodeType&&this.createDOM(e)}},{key:"merge",value:function(e,n,r){return!(8&this.flags||r&&(!(r instanceof t)||this.length-(n-e)+r.length>256||8&r.flags))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}},{key:"split",value:function(e){var n=new t(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=8&this.flags,n}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new K(this.dom,e)}},{key:"domBoundsAround",value:function(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(e,t){return function(e,t,n){var r=e.nodeValue.length;t>r&&(t=r);var i=t,o=t,a=0;0==t&&n<0||t==r&&n>=0?ve.chrome||ve.gecko||(t?(i--,a=1):o=0)?0:s.length-1];ve.safari&&!a&&0==u.width&&(u=Array.prototype.find.call(s,(function(e){return e.width}))||u);return a?N(u,a<0):u||null}(this.dom,e,t)}}]),t}(ee),ye=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;_(this,t),(n=d(this,t)).mark=e,n.children=r,n.length=i;var o,a=w(r);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.setParent(m(n))}}catch(e){a.e(e)}finally{a.f()}return n}return y(t,e),E(t,[{key:"setAttrs",value:function(e){if(X(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(var t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}},{key:"canReuseDOM",value:function(e){return h(g(t.prototype),"canReuseDOM",this).call(this,e)&&!(8&(this.flags|e.flags))}},{key:"reuseDOM",value:function(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}},{key:"sync",value:function(e,n){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),h(g(t.prototype),"sync",this).call(this,e,n)}},{key:"merge",value:function(e,n,r,i,o,a){return(!r||!(!(r instanceof t&&r.mark.eq(this.mark))||e&&o<=0||ne&&r.push(i=e&&(o=a),i=c,a++}}catch(e){s.e(e)}finally{s.f()}var l=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new t(this.mark,r,l)}},{key:"domAtPos",value:function(e){return we(this,e)}},{key:"coordsAt",value:function(e,t){return ke(this,e,t)}}]),t}(ee);var be=function(e){function t(e,n,r){var i;return _(this,t),(i=d(this,t)).widget=e,i.length=n,i.side=r,i.prevWidget=null,i}return y(t,e),E(t,[{key:"split",value:function(e){var n=t.create(this.widget,this.length-e,this.side);return this.length-=e,n}},{key:"sync",value:function(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,n,r,i,o,a){return!(r&&(!(r instanceof t&&this.widget.compare(r.widget))||e>0&&o<=0||n0)?K.before(this.dom):K.after(this.dom,e==this.length)}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(e,t){var n=this.widget.coordsAt(this.dom,e,t);if(n)return n;var r=this.dom.getClientRects(),i=null;if(!r.length)return null;for(var o=this.side?this.side<0:e>0,a=o?r.length-1:0;i=r[a],!(e>0?0==a:a==r.length-1||i.top0?K.before(this.dom):K.after(this.dom)}},{key:"localPosFromDOM",value:function(){return 0}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(e){return this.dom.getBoundingClientRect()}},{key:"overrideDOMText",get:function(){return r.p.empty}},{key:"isHidden",get:function(){return!0}}]),t}(ee);function we(e,t){for(var n=e.dom,r=e.children,i=0,o=0;io&&t0;u--){var c=r[u-1];if(c.dom.parentNode==n)return c.domAtPos(c.length)}for(var l=i;l0&&t instanceof ye&&i.length&&(r=i[i.length-1])instanceof ye&&r.mark.eq(t.mark)?xe(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function ke(e,t,n){var r=null,i=-1,o=null,a=-1;!function e(t,s){for(var u=0,c=0;u=s&&(l.children.length?e(l,s-c):(!o||o.isHidden&&n>0)&&(f>s||c==f&&l.getSide()>0)?(o=l,a=s-c):(c-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(var o=0,a=r;o-1}}],[{key:"mark",value:function(e){return new Re(e)}},{key:"widget",value:function(e){var t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Qe(e,t,t,n,e.widget||null,!1)}},{key:"replace",value:function(e){var t,n,r=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{var i=Ie(e,r);t=(i.start?r?-3e8:-1:5e8)-1,n=1+(i.end?r?2e8:1:-6e8)}return new Qe(e,t,n,r,e.widget||null,!0)}},{key:"line",value:function(e){return new $e(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r.k.of(e,t)}}]),t}(r.m);Ae.none=r.k.empty;var Re=function(e){function t(e){var n;_(this,t);var r=Ie(e);return(n=d(this,t,[r.start?-1:5e8,r.end?1:-6e8,null,e])).tagName=e.tagName||"span",n.class=e.class||"",n.attrs=e.attributes||null,n}return y(t,e),E(t,[{key:"eq",value:function(e){var n,r;return this==e||e instanceof t&&this.tagName==e.tagName&&(this.class||(null===(n=this.attrs)||void 0===n?void 0:n.class))==(e.class||(null===(r=e.attrs)||void 0===r?void 0:r.class))&&Pe(this.attrs,e.attrs,"class")}},{key:"range",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e>=n)throw new RangeError("Mark decorations may not be empty");return h(g(t.prototype),"range",this).call(this,e,n)}}]),t}(Ae);Re.prototype.point=!1;var $e=function(e){function t(e){return _(this,t),d(this,t,[-2e8,-2e8,null,e])}return y(t,e),E(t,[{key:"eq",value:function(e){return e instanceof t&&this.spec.class==e.spec.class&&Pe(this.spec.attributes,e.spec.attributes)}},{key:"range",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return h(g(t.prototype),"range",this).call(this,e,n)}}]),t}(Ae);$e.prototype.mapMode=r.i.TrackBefore,$e.prototype.point=!0;var Qe=function(e){function t(e,n,i,o,a,s){var u;return _(this,t),(u=d(this,t,[n,i,a,e])).block=o,u.isReplace=s,u.mapMode=o?n<=0?r.i.TrackBefore:r.i.TrackAfter:r.i.TrackDel,u}return y(t,e),E(t,[{key:"type",get:function(){return this.startSide!=this.endSide?Ce.WidgetRange:this.startSide<=0?Ce.WidgetBefore:Ce.WidgetAfter}},{key:"heightRelevant",get:function(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}},{key:"eq",value:function(e){return e instanceof t&&(n=this.widget,r=e.widget,n==r||!!(n&&r&&n.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var n,r}},{key:"range",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return h(g(t.prototype),"range",this).call(this,e,n)}}]),t}(Ae);function Ie(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.inclusiveStart,r=e.inclusiveEnd;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function Me(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}Qe.prototype.point=!0;var De=function(e){function t(){var e;return _(this,t),(e=d(this,t,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return y(t,e),E(t,[{key:"merge",value:function(e,n,r,i,o,a){if(r){if(!(r instanceof t))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),ie(this,e,n,r?r.children.slice():[],o,a),!0}},{key:"split",value:function(e){var n=new t;if(n.breakAfter=this.breakAfter,0==this.length)return n;var r=this.childPos(e),i=r.i,o=r.off;o&&(n.append(this.children[i].split(o),0),this.children[i].merge(o,this.children[i].length,null,!1,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,n}},{key:"transferDOM",value:function(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){Pe(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){xe(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Se(t,this.attrs||{})),n&&(this.attrs=Se({class:n},this.attrs||{}))}},{key:"domAtPos",value:function(e){return we(this,e)}},{key:"reuseDOM",value:function(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}},{key:"sync",value:function(e,n){var r;this.dom?4&this.flags&&(X(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Ee(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),h(g(t.prototype),"sync",this).call(this,e,n);for(var i=this.dom.lastChild;i&&ee.get(i)instanceof ye;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(r=ee.get(i))||void 0===r?void 0:r.isEditable)||ve.ios&&this.children.some((function(e){return e instanceof ge}))))){var o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t,n=0,r=w(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!(i instanceof ge)||/[^ -~]/.test(i.text))return null;var o=R(i.dom);if(1!=o.length)return null;n+=o[0].width,e=o[0].height}}catch(e){r.e(e)}finally{r.f()}return n?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:n/this.length,textHeight:e}:null}},{key:"coordsAt",value:function(e,t){var n=ke(this,e,t);if(!this.children.length&&n&&this.parent){var r=this.parent.view.viewState.heightOracle,i=n.bottom-n.top;if(Math.abs(i-r.lineHeight)<2&&r.textHeight=n){if(o instanceof t)return o;if(a>n)break}i=a+o.breakAfter}return null}}]),t}(ee),Ne=function(e){function t(e,n,r){var i;return _(this,t),(i=d(this,t)).widget=e,i.length=n,i.deco=r,i.breakAfter=0,i.prevWidget=null,i}return y(t,e),E(t,[{key:"merge",value:function(e,n,r,i,o,a){return!(r&&(!(r instanceof t&&this.widget.compare(r.widget))||e>0&&o<=0||n0)}}]),t}(ee),Fe=function(e){function t(e){var n;return _(this,t),(n=d(this,t)).height=e,n}return y(t,e),E(t,[{key:"toDOM",value:function(){var e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}},{key:"eq",value:function(e){return e.height==this.height}},{key:"updateDOM",value:function(e){return e.style.height=this.height+"px",!0}},{key:"editable",get:function(){return!0}},{key:"estimatedHeight",get:function(){return this.height}},{key:"ignoreEvent",value:function(){return!1}}]),t}(je),Le=function(){function e(t,n,r,i){_(this,e),this.doc=t,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=n}return E(e,[{key:"posCovered",value:function(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ne&&e.deco.endSide<0)}},{key:"getLine",value:function(){return this.curLine||(this.content.push(this.curLine=new De),this.atCursorPos=!0),this.curLine}},{key:"flushBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.bufferMarks;this.pendingBuffer&&(this.curLine.append(qe(new Oe(-1),e),e.length),this.pendingBuffer=0)}},{key:"addBlockWidget",value:function(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}},{key:"finish",value:function(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof Ne||this.getLine()}},{key:"buildText",value:function(e,t,n){for(;e>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(qe(new ge(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=0}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Qe){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}var a=t-e;if(n instanceof Qe)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ne(n.widget||ze.block,a,n));else{var s=be.create(n.widget||ze.inline,a,a?0:n.startSide),u=this.atCursorPos&&!s.isEditable&&i<=r.length&&(e0),c=!s.isEditable&&(er.length||n.startSide<=0),l=this.getLine();2!=this.pendingBuffer||u||s.isEditable||(this.pendingBuffer=0),this.flushBuffer(r),u&&(l.append(qe(new Oe(1),r),i),i=r.length+Math.max(0,i-r.length)),l.append(qe(s,r),i),this.atCursorPos=c,this.pendingBuffer=c?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(t,n,i,o,a){var s=new e(t,n,i,a);return s.openEnd=r.k.spans(o,n,i,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}]),e}();function qe(e,t){var n,r=w(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e=new ye(i,[e],e.length)}}catch(e){r.e(e)}finally{r.f()}return e}var ze=function(e){function t(e){var n;return _(this,t),(n=d(this,t)).tag=e,n}return y(t,e),E(t,[{key:"eq",value:function(e){return e.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(e){return e.nodeName.toLowerCase()==this.tag}},{key:"isHidden",get:function(){return!0}}]),t}(je);ze.inline=new ze("span"),ze.block=new ze("div");var Ue=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Ue||(Ue={})),Be=Ue.LTR,Ze=Ue.RTL;function Ve(e){for(var t=[],n=0;n=t){if(a.level==n)return o;(i<0||(0!=r?r<0?a.fromt:e[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}();function ot(e,t){if(e.length!=t.length)return!1;for(var n=0;nu&&a.push(new it(u,v.from,d)),ut(e,v.direction==Be!=!(d%2)?r+1:r,i,v.inner,v.from,v.to,a),u=v.to;m=v.to}else{if(m==n||(l?at[m]!=s:at[m]==s))break;m++}p?st(e,u,m,r+1,i,p,a):ut;){var w=!0,x=!1;if(!O||b>o[O-1].to){var k=at[b-1];k!=s&&(w=!1,x=16==k)}var S=w||1!=s?null:[],_=w?r:r+1,P=b;e:for(;;)if(O&&P==o[O-1].to){if(x)break e;var E=o[--O];if(!w)for(var T=E.from,j=O;;){if(T==t)break e;if(!j||o[j-1].to!=T){if(at[T-1]==s)break e;break}T=o[--j].from}if(S)S.push(E);else E.to=0;m-=3)if(Ge[m+1]==-l){var v=Ge[m+2],g=2&v?i:4&v?1&v?o:i:0;g&&(at[d]=at[Ge[m]]=g),s=m;break}}else{if(189==Ge.length)break;Ge[s++]=d,Ge[s++]=c,Ge[s++]=u}else if(2==(f=at[d])||1==f){var y=f==i;u=y?0:1;for(var b=s-3;b>=0;b-=3){var O=Ge[b+2];if(2&O)break;if(y)Ge[b+2]|=2;else{if(4&O)break;Ge[b+2]|=4}}}}(e,i,o,r,s),function(e,t,n,r){for(var i=0,o=r;i<=n.length;i++)for(var a=i?n[i-1].to:e,s=iu;)p==m&&(p=n[--d].from,m=d?n[d-1].to:e),at[--p]=h;u=l}else o=c,u++}}(i,o,r,s),st(e,i,o,t,n,r,a)}function ct(e,t,n){if(!e)return[new it(0,0,t==Ze?1:0)];if(t==Be&&!n.length&&!rt.test(e))return lt(e.length);if(n.length)for(;e.length>at.length;)at[at.length]=256;var r=[],i=t==Be?0:1;return ut(e,i,i,n,0,e.length,r),r}function lt(e){return[new it(0,e,0)]}var ft="";function ht(e,t,n,i,o){var a,s=i.head-e.from,u=it.find(t,s,null!==(a=i.bidiLevel)&&void 0!==a?a:-1,i.assoc),c=t[u],l=c.side(o,n);if(s==l){var f=u+=o?1:-1;if(f<0||f>=t.length)return null;s=(c=t[u=f]).side(!o,n),l=c.side(o,n)}var h=Object(r.v)(e.text,s,c.forward(o,n));(hc.to)&&(h=l),ft=e.text.slice(Math.min(s,h),Math.max(s,h));var p=u==(o?t.length-1:0)?null:t[u+(o?1:-1)];return p&&h==l&&p.level+(o?0:1)1&&void 0!==arguments[1]?arguments[1]:"nearest",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"nearest",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];_(this,e),this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=a}return E(e,[{key:"map",value:function(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},{key:"clip",value:function(t){return this.range.to<=t.doc.length?this:new e(r.f.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}]),e}(),Et=r.n.define({map:function(e,t){return e.map(t)}}),Tt=r.n.define();function jt(e,t,n){var r=e.facet(gt);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}var Ct=r.h.define({combine:function(e){return!e.length||e[0]}}),At=0,Rt=r.h.define(),$t=function(){function e(t,n,r,i,o){_(this,e),this.id=t,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}return E(e,null,[{key:"define",value:function(t,n){var r=n||{},i=r.eventHandlers,o=r.eventObservers,a=r.provide,s=r.decorations;return new e(At++,t,i,o,(function(e){var t=[Rt.of(e)];return s&&t.push(Dt.of((function(t){var n=t.plugin(e);return n?s(n):Ae.none}))),a&&t.push(a(e)),t}))}},{key:"fromClass",value:function(t,n){return e.define((function(e){return new t(e)}),n)}}]),e}(),Qt=function(){function e(t){_(this,e),this.spec=t,this.mustUpdate=null,this.value=null}return E(e,[{key:"update",value:function(e){if(this.value){if(this.mustUpdate){var t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(jt(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){jt(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}},{key:"destroy",value:function(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){jt(e.state,t,"CodeMirror plugin crashed")}}},{key:"deactivate",value:function(){this.spec=this.value=null}}]),e}(),It=r.h.define(),Mt=r.h.define(),Dt=r.h.define(),Nt=r.h.define(),Ft=r.h.define(),Lt=r.h.define();function qt(e,t){var n=e.state.facet(Lt);if(!n.length)return n;var i=n.map((function(t){return t instanceof Function?t(e):t})),o=[];return r.k.spans(i,t.from,t.to,{point:function(){},span:function(e,n,r,i){for(var a=e-t.from,s=n-t.from,u=o,c=r.length-1;c>=0;c--,i--){var l=r[c].spec.bidiIsolate,f=void 0;if(null==l&&(l=pt(t.text,a,s)),i>0&&u.length&&(f=u[u.length-1]).to==a&&f.direction==l)f.to=s,u=f.inner;else{var h={from:a,to:s,direction:l,inner:[]};u.push(h),u=h.inner}}}}),o}var zt=r.h.define();function Ut(e){var t,n=0,r=0,i=0,o=0,a=w(e.state.facet(zt));try{for(a.s();!(t=a.n()).done;){var s=(0,t.value)(e);s&&(null!=s.left&&(n=Math.max(n,s.left)),null!=s.right&&(r=Math.max(r,s.right)),null!=s.top&&(i=Math.max(i,s.top)),null!=s.bottom&&(o=Math.max(o,s.bottom)))}}catch(e){a.e(e)}finally{a.f()}return{left:n,right:r,top:i,bottom:o}}var Bt=r.h.define(),Zt=function(){function e(t,n,r,i){_(this,e),this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}return E(e,[{key:"join",value:function(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}},{key:"addToSet",value:function(e){for(var t=e.length,n=this;t>0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAl)break;o+=2}if(!u)return r;new e(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),a=u.toA,s=u.toB}}}]),e}(),Vt=function(){function e(t,n,i){_(this,e),this.view=t,this.state=n,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=r.c.empty(this.startState.doc.length);var o,a=w(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.changes=this.changes.compose(s.changes)}}catch(e){a.e(e)}finally{a.f()}var u=[];this.changes.iterChangedRanges((function(e,t,n,r){return u.push(new Zt(e,t,n,r))})),this.changedRanges=u}return E(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(10&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}],[{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}(),Wt=function(e){function t(e){var n;return _(this,t),(n=d(this,t)).view=e,n.decorations=[],n.dynamicDecorationMap=[!1],n.domChanged=null,n.hasComposition=null,n.markedForComposition=new Set,n.editContextFormatting=Ae.none,n.lastCompositionAfterCursor=!1,n.minWidth=0,n.minWidthFrom=0,n.minWidthTo=0,n.impreciseAnchor=null,n.impreciseHead=null,n.forceSelection=!1,n.lastUpdate=Date.now(),n.setDOM(e.contentDOM),n.children=[new De],n.children[0].setParent(m(n)),n.updateDeco(),n.updateInner([new Zt(0,0,0,e.state.doc.length)],0,null),n}return y(t,e),E(t,[{key:"length",get:function(){return this.view.state.doc.length}},{key:"update",value:function(e){var t,n=this,i=e.changedRanges;this.minWidth>0&&i.length&&(i.every((function(e){var t=e.fromA;return e.toAn.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);var o=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?o=this.domChanged.newSel.head:function(e,t){var n=!1;t&&e.iterChangedRanges((function(e,r){et.from&&(n=!0)}));return n}(e.changes,this.hasComposition)||e.selectionSet||(o=e.state.selection.main.head));var a=o>-1?function(e,t,n){var r=Yt(e,n);if(!r)return null;var i=r.node,o=r.from,a=r.to,s=i.nodeValue;if(/[\n\r]/.test(s))return null;if(e.state.doc.sliceString(r.from,r.to)!=s)return null;for(var u=t.invertedDesc,c=new Zt(u.mapPos(o),u.mapPos(a),o,a),l=[],f=i.parentNode;;f=f.parentNode){var h=ee.get(f);if(h instanceof ye)l.push({node:f,deco:h.mark});else{if(h instanceof De||"DIV"==f.nodeName&&f.parentNode==e.contentDOM)return{range:c,text:i,marks:l,line:f};if(f==e.contentDOM)return null;l.push({node:f,deco:new Re({inclusive:!0,attributes:Te(f),tagName:f.tagName.toLowerCase()})})}}}(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();var s=this.hasComposition,u=s.from,c=s.to;i=new Zt(u,c,e.changes.mapPos(u,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(ve.ie||ve.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);var l,f,h,p,d=this.decorations,m=this.updateDeco(),v=(l=d,f=m,h=e.changes,p=new Ht,r.k.compare(l,f,h,p),p.changes);return i=Zt.extendWithRanges(i,v),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,e.startState.doc.length,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}},{key:"updateInner",value:function(e,t,n){var r=this;this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);var i=this.view.observer;i.ignore((function(){r.dom.style.height=r.view.viewState.contentHeight/r.view.scaleY+"px",r.dom.style.flexBasis=r.minWidth?r.minWidth+"px":"";var e=ve.chrome||ve.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;r.sync(r.view,e),r.flags&=-8,e&&(e.written||i.selectionRange.focusNode!=e.node)&&(r.forceSelection=!0),r.dom.style.height=""})),this.markedForComposition.forEach((function(e){return e.flags&=-9}));var o=[];if(this.view.viewport.from||this.view.viewport.to=0?r[o]:null;if(!a)break;var s=a.fromA,u=a.toA,c=a.fromB,l=a.toB,f=void 0,h=void 0,p=void 0,d=void 0;if(n&&n.range.fromBc){var m=Le.build(this.view.state.doc,c,n.range.fromB,this.decorations,this.dynamicDecorationMap),v=Le.build(this.view.state.doc,n.range.toB,l,this.decorations,this.dynamicDecorationMap);h=m.breakAtStart,p=m.openStart,d=v.openEnd;var g=this.compositionView(n);v.breakAtStart?g.breakAfter=1:v.content.length&&g.merge(g.length,g.length,v.content[0],!1,v.openStart,0)&&(g.breakAfter=v.content[0].breakAfter,v.content.shift()),m.content.length&&g.merge(0,0,m.content[m.content.length-1],!0,0,m.openEnd)&&m.content.pop(),f=m.content.concat(g).concat(v.content)}else{var y=Le.build(this.view.state.doc,c,l,this.decorations,this.dynamicDecorationMap);f=y.content,h=y.breakAtStart,p=y.openStart,d=y.openEnd}var b=i.findPos(u,1),O=b.i,w=b.off,x=i.findPos(s,-1);re(this,x.i,x.off,O,w,f,h,p,d)}n&&this.fixCompositionDOM(n)}},{key:"updateEditContextFormatting",value:function(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);var t,n=w(e.transactions);try{for(n.s();!(t=n.n()).done;){var r,i=w(t.value.effects);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.is(Tt)&&(this.editContextFormatting=o.value)}}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}}},{key:"compositionView",value:function(e){var t=new ge(e.text.nodeValue);t.flags|=8;var n,r=w(e.marks);try{for(r.s();!(n=r.n()).done;){var i=n.value.deco;t=new ye(i,[t],t.length)}}catch(e){r.e(e)}finally{r.f()}var o=new De;return o.append(t,0),o}},{key:"fixCompositionDOM",value:function(e){var t=this,n=function(e,n){n.flags|=8|(n.children.some((function(e){return 7&e.flags}))?1:0),t.markedForComposition.add(n);var r=ee.get(e);r&&r!=n&&(r.dom=null),n.setDOM(e)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(var o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}},{key:"updateSelection",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();var r=this.view.root.activeElement,i=r==this.dom,o=!i&&A(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(i||n||o){var a=this.forceSelection;this.forceSelection=!1;var s=this.view.state.selection.main,u=this.moveToLine(this.domAtPos(s.anchor)),c=s.empty?u:this.moveToLine(this.domAtPos(s.head));if(ve.gecko&&s.empty&&!this.hasComposition&&Xt(u)){var l=document.createTextNode("");this.view.observer.ignore((function(){return u.node.insertBefore(l,u.node.childNodes[u.offset]||null)})),u=c=new K(l,0),a=!0}var f=this.view.observer.selectionRange;!a&&f.focusNode&&($(u.node,u.offset,f.anchorNode,f.anchorOffset)&&$(c.node,c.offset,f.focusNode,f.focusOffset)||this.suppressWidgetCursorChange(f,s))||(this.view.observer.ignore((function(){ve.android&&ve.chrome&&e.dom.contains(f.focusNode)&&Kt(f.focusNode,e.dom)&&(e.dom.blur(),e.dom.focus({preventScroll:!0}));var t=j(e.view.root);if(t)if(s.empty){if(ve.gecko){var n=Gt(u.node,u.offset);if(n&&3!=n){var i=(1==n?G:H)(u.node,u.offset);i&&(u=new K(i.node,i.offset))}}t.collapse(u.node,u.offset),null!=s.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=s.bidiLevel)}else if(t.extend){t.collapse(u.node,u.offset);try{t.extend(c.node,c.offset)}catch(e){}}else{var a=document.createRange();if(s.anchor>s.head){var l=[c,u];u=l[0],c=l[1]}a.setEnd(c.node,c.offset),a.setStart(u.node,u.offset),t.removeAllRanges(),t.addRange(a)}else;o&&e.view.root.activeElement==e.dom&&(e.dom.blur(),r&&r.focus())})),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new K(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new K(f.focusNode,f.focusOffset)}}},{key:"suppressWidgetCursorChange",value:function(e,t){return this.hasComposition&&t.empty&&$(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}},{key:"enforceCursorAssoc",value:function(){if(!this.hasComposition){var e=this.view,t=e.state.selection.main,n=j(e.root),r=e.observer.selectionRange,i=r.anchorNode,o=r.anchorOffset;if(n&&t.empty&&t.assoc&&n.modify){var a=De.find(this,t.head);if(a){var s=a.posAtStart;if(t.head!=s&&t.head!=s+a.length){var u=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(u&&c&&!(u.bottom>c.top)){var l=this.domAtPos(t.head+t.assoc);n.collapse(l.node,l.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();var f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&n.collapse(i,o)}}}}}}},{key:"moveToLine",value:function(e){var t,n=this.dom;if(e.node!=n)return e;for(var r=e.offset;!t&&r=0;o--){var a=ee.get(n.childNodes[o]);a instanceof De&&(t=a.domAtPos(a.length))}return t?new K(t.node,t.offset,!0):e}},{key:"nearest",value:function(e){for(var t=e;t;){var n=ee.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;n=0;o--){var a=this.children[o],s=i-a.breakAfter,u=s-a.length;if(se||a.covers(1))&&(!n||a instanceof De&&!(n instanceof De&&t>=0)))n=a,r=u;else if(n&&u==e&&s==e&&a instanceof Ne&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(n=null)}i=u}return n?n.coordsAt(e-r,t):null}},{key:"coordsForChar",value:function(e){var t=this.childPos(e,1),n=t.i,i=t.off,o=this.children[n];if(!(o instanceof De))return null;for(;o.children.length;){for(var a=o.childPos(i,1),s=a.i,u=a.off;;s++){if(s==o.children.length)return null;if((o=o.children[s]).length)break}i=u}if(!(o instanceof ge))return null;var c=Object(r.v)(o.text,i);if(c==i)return null;for(var l=Z(o.dom,i,c).getClientRects(),f=0;fMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=this.view.textDirection==Ue.LTR,u=0,c=0;cr)break;if(u>=n){var h=l.dom.getBoundingClientRect();if(t.push(h.height),o){var p=l.dom.lastChild,d=p?R(p):[];if(d.length){var m=d[d.length-1],v=s?m.right-h.left:h.right-m.left;v>a&&(a=v,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=f)}}}u=f+l.breakAfter}return t}},{key:"textDirectionAt",value:function(e){var t=this.childPos(e,1).i;return"rtl"==getComputedStyle(this.children[t].dom).direction?Ue.RTL:Ue.LTR}},{key:"measureTextSize",value:function(){var e,t=this,n=w(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof De){var i=r.measureTextSize();if(i)return i}}}catch(e){n.e(e)}finally{n.f()}var o,a,s,u=document.createElement("div");return u.className="cm-line",u.style.width="99999px",u.style.position="absolute",u.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(u);var e=R(u.firstChild)[0];o=u.getBoundingClientRect().height,a=e?e.width/27:7,s=e?e.height:o,u.remove()})),{lineHeight:o,charWidth:a,textHeight:s}}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,t=this.children.length;return t&&(e-=this.children[--t].length),new ne(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){for(var e=[],t=this.view.viewState,n=0,r=0;;r++){var i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Ae.replace({widget:new Fe(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return Ae.set(e)}},{key:"updateDeco",value:function(){var e=this,t=1,n=this.view.state.facet(Dt).map((function(n){return(e.dynamicDecorationMap[t++]="function"==typeof n)?n(e.view):n})),i=!1,o=this.view.state.facet(Nt).map((function(t,n){var r="function"==typeof t;return r&&(i=!0),r?t(e.view):t}));for(o.length&&(this.dynamicDecorationMap[t++]=i,n.push(r.k.join(o))),this.decorations=[this.editContextFormatting].concat(O(n),[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]);ta.anchor?-1:1);if(s){!a.empty&&(o=this.coordsAt(a.anchor,a.anchor>a.head?-1:1))&&(s={left:Math.min(s.left,o.left),top:Math.min(s.top,o.top),right:Math.max(s.right,o.right),bottom:Math.max(s.bottom,o.bottom)});var u=Ut(this.view),c={left:s.left-u.left,top:s.top-u.top,right:s.right+u.right,bottom:s.bottom+u.bottom},l=this.view.scrollDOM,f=l.offsetWidth,h=l.offsetHeight;!function(e,t,n,r,i,o,a,s){for(var u=e.ownerDocument,c=u.defaultView||window,l=e,f=!1;l&&!f;)if(1==l.nodeType){var h=void 0,p=l==u.body,d=1,m=1;if(p)h=F(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(l).position)&&(f=!0),l.scrollHeight<=l.clientHeight&&l.scrollWidth<=l.clientWidth){l=l.assignedSlot||l.parentNode;continue}var v=l.getBoundingClientRect(),g=L(l,v);d=g.scaleX,m=g.scaleY,h={left:v.left,right:v.left+l.clientWidth*d,top:v.top,bottom:v.top+l.clientHeight*m}}var y=0,b=0;if("nearest"==i)t.top0&&t.bottom>h.bottom+b&&(b=t.bottom-h.bottom+b+a)):t.bottom>h.bottom&&(b=t.bottom-h.bottom+a,n<0&&t.top-b0&&t.right>h.right+y&&(y=t.right-h.right+y+o)):t.right>h.right&&(y=t.right-h.right+o,n<0&&t.lefte?t.left-e:Math.max(0,e-t.right)}function en(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function tn(e,t){return e.topt.top+1}function nn(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function on(e,t,n){for(var r,i,o,a,s,u,c,l,f=!1,h=e.firstChild;h;h=h.nextSibling)for(var p=R(h),d=0;dg||a==g&&o>v){r=h,i=m,o=v,a=g;var y=g?n0?d0)}0==v?n>m.bottom&&(!c||c.bottomm.top)&&(u=h,l=m):c&&tn(c,m)?c=rn(c,m.bottom):l&&tn(l,m)&&(l=nn(l,m.top))}if(c&&c.bottom>=n?(r=s,i=c):l&&l.top<=n&&(r=u,i=l),!r)return{node:e,offset:0};var b=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?an(r,b,n):f&&"false"!=r.contentEditable?on(r,b,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}}function an(e,t,n){for(var r=e.nodeValue.length,i=-1,o=1e9,a=0,s=0;sn?l.top-n:n-l.bottom)-1;if(l.left-1<=t&&l.right+1>=t&&f=(l.left+l.right)/2,p=h;if(ve.chrome||ve.gecko)Z(e,s).getBoundingClientRect().left==l.right&&(p=!h);if(f<=0)return{node:e,offset:s+(p?1:0)};i=s+(p?1:0),o=f}}}return{node:e,offset:i>-1?i:a>0?e.nodeValue.length:0}}function sn(e,t,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=e.contentDOM.getBoundingClientRect(),u=s.top+e.viewState.paddingTop,c=e.viewState.docHeight,l=t.x,f=t.y,h=f-u;if(h<0)return 0;if(h>c)return e.state.doc.length;for(var p=e.viewState.heightOracle.textHeight/2,d=!1;(o=e.elementAtHeight(h)).type!=Ce.Text;)for(;!((h=a>0?o.bottom+p:o.top-p)>=0&&h<=c);){if(d)return n?null:0;d=!0,a=-a}f=u+h;var m=o.from;if(me.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:un(e,s,o,l,f);var v=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:v,y=g.elementFromPoint(l,f);y&&!e.contentDOM.contains(y)&&(y=null),y||(l=Math.max(s.left+1,Math.min(s.right-1,l)),(y=g.elementFromPoint(l,f))&&!e.contentDOM.contains(y)&&(y=null));var b,O=-1;if(y&&0!=(null===(r=e.docView.nearest(y))||void 0===r?void 0:r.isEditable)){if(v.caretPositionFromPoint){var w=v.caretPositionFromPoint(l,f);w&&(b=w.offsetNode,O=w.offset)}else if(v.caretRangeFromPoint){var x=v.caretRangeFromPoint(l,f);x&&(b=x.startContainer,O=x.startOffset,(!e.contentDOM.contains(b)||ve.safari&&cn(b,O,l)||ve.chrome&&ln(b,O,l))&&(b=void 0))}b&&(O=Math.min(D(b),O))}if(!b||!e.docView.dom.contains(b)){var k=De.find(e.docView,m);if(!k)return h>o.top+o.height/2?o.to:o.from;var S=on(k.dom,l,f);b=S.node,O=S.offset}var _=e.docView.nearest(b);if(!_)return null;if(_.isWidget&&1==(null===(i=_.dom)||void 0===i?void 0:i.nodeType)){var P=_.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){var s=e.viewState.heightOracle.textHeight;a+=Math.floor((o-n.top-.5*(e.defaultLineHeight-s))/s)*e.viewState.heightOracle.lineLength}var u=e.state.sliceDoc(n.from,n.to);return n.from+Object(r.w)(u,a,e.state.tabSize)}function cn(e,t,n){var r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(var i=e.nextSibling;i;i=i.nextSibling)if(1!=i.nodeType||"BR"!=i.nodeName)return!1;return Z(e,r-1,r).getBoundingClientRect().left>n}function ln(e,t,n){if(0!=t)return!1;for(var r=e;;){var i=r.parentNode;if(!i||1!=i.nodeType||i.firstChild!=r)return!1;if(i.classList.contains("cm-line"))break;r=i}return n-(1==e.nodeType?e.getBoundingClientRect():Z(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}function fn(e,t){var n=e.lineBlockAt(t);if(Array.isArray(n.type)){var r,i=w(n.type);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.to>t||o.to==t&&(o.to==n.to||o.type==Ce.Text))return o}}catch(e){i.e(e)}finally{i.f()}}return n}function hn(e,t,n,i){var o=fn(e,t.head),a=i&&o.type==Ce.Text&&(e.lineWrapping||o.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>o.from?t.head-1:t.head):null;if(a){var s=e.dom.getBoundingClientRect(),u=e.textDirectionAt(o.from),c=e.posAtCoords({x:n==(u==Ue.LTR)?s.right-1:s.left+1,y:(a.top+a.bottom)/2});if(null!=c)return r.f.cursor(c,n?-1:1)}return r.f.cursor(n?o.to:o.from,n?-1:1)}function pn(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=e.textDirectionAt(i.from),s=t,u=null;;){var c=ht(i,o,a,s,n),l=ft;if(!c){if(i.number==(n?e.state.doc.lines:1))return s;l="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),c=e.visualLineSide(i,!n)}if(u){if(!u(l))return s}else{if(!r)return c;u=r(l)}s=c}}function dn(e,t,n){for(var r,i=function(){var r,i=0,o=w(e);try{for(o.s();!(r=o.n()).done;){r.value.between(t-1,t+1,(function(e,r,o){if(t>e&&tn.from?-1:1);return i==n.from?n:r.f.cursor(i,ii)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}},{key:"readTextNode",value:function(e){var t,n=e.nodeValue,r=w(this.points);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length))}}catch(e){r.e(e)}finally{r.f()}for(var o=0,a=this.lineSeparator?null:/\r\n?|\n/g;;){var s=-1,u=1,c=void 0;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,o),u=this.lineSeparator.length):(c=a.exec(n))&&(s=c.index,u=c[0].length),this.append(n.slice(o,s<0?n.length:s)),s<0)break;if(this.lineBreak(),u>1){var l,f=w(this.points);try{for(f.s();!(l=f.n()).done;){var h=l.value;h.node==e&&h.pos>this.text.length&&(h.pos-=u-1)}}catch(e){f.e(e)}finally{f.f()}}o=s+u}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t=ee.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(var r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}}},{key:"findPointBefore",value:function(e,t){var n,r=w(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}}catch(e){r.e(e)}finally{r.f()}}},{key:"findPointInside",value:function(e,t){var n,r=w(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;(3==e.nodeType?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(yn(e,i.node,i.offset)?t:0))}}catch(e){r.e(e)}finally{r.f()}}}]),e}();function yn(e,t,n){for(;;){if(!t||n-1;var a=t.docView,s=a.impreciseHead,u=a.impreciseAnchor;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=t.docView.domBoundsAround(n,i,0))){var c=s||u?[]:function(e){var t=[];if(e.root.activeElement!=e.contentDOM)return t;var n=e.observer.selectionRange,r=n.anchorNode,i=n.anchorOffset,o=n.focusNode,a=n.focusOffset;r&&(t.push(new bn(r,i)),o==r&&a==i||t.push(new bn(o,a)));return t}(t),l=new gn(c,t.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=function(e,t){if(0==e.length)return null;var n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?r.f.single(n+t,i+t):null}(c,this.bounds.from)}else{var f=t.observer.selectionRange,h=s&&s.node==f.focusNode&&s.offset==f.focusOffset||!C(t.contentDOM,f.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(f.focusNode,f.focusOffset),p=u&&u.node==f.anchorNode&&u.offset==f.anchorOffset||!C(t.contentDOM,f.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(f.anchorNode,f.anchorOffset),d=t.viewport;if((ve.ios||ve.chrome)&&t.state.selection.main.empty&&h!=p&&(d.from>0||d.toDate.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){var s=t.bounds,u=s.from,c=s.to,l=o.from,f=null;(8===a||ve.android&&t.text.length0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(e.state.doc.sliceString(u,c,vn),t.text,l-u,f);h&&(ve.chrome&&13==a&&h.toB==h.from+2&&t.text.slice(h.from,h.toB)==vn+vn&&h.toB--,n={from:u+h.from,to:u+h.toA,insert:r.p.of(t.text.slice(h.from,h.toB).split(vn))})}else i&&(!e.hasFocus&&e.state.facet(Ct)||i.main.eq(o))&&(i=null);if(!n&&!i)return!1;if(!n&&t.typeOver&&!o.empty&&i&&i.main.empty?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:n&&n.from>=o.from&&n.to<=o.to&&(n.from!=o.from||n.to!=o.to)&&o.to-o.from-(n.to-n.from)<=4?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,o.to))}:(ve.mac||ve.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=r.f.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:r.p.of([" "])}):ve.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=r.f.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:r.p.of([" "])}),n)return xn(e,n,i,a);if(i&&!i.main.eq(o)){var p=!1,d="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(p=!0),d=e.inputState.lastSelectionOrigin),e.dispatch({selection:i,scrollIntoView:p,userEvent:d}),!0}return!1}function xn(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;if(ve.ios&&e.inputState.flushIOSKey(t))return!0;var i=e.state.selection.main;if(ve.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&" "==e.state.sliceDoc(t.from,i.from))&&1==t.insert.length&&2==t.insert.lines&&V(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&0==t.insert.length||8==r&&t.insert.lengthi.head)&&V(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&0==t.insert.length&&V(e.contentDOM,"Delete",46)))return!0;var o,a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;var s=function(){return o||(o=kn(e,t,n))};return e.state.facet(bt).some((function(n){return n(e,t.from,t.to,a,s)}))||e.dispatch(s()),!0}function kn(e,t,n){var i,o=e.state,a=o.selection.main;if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){var s=a.fromt.to?o.sliceDoc(t.to,a.to):"";i=o.replaceSelection(e.state.toText(s+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{var c=o.changes(t),l=n&&n.main.to<=c.newLength?n.main:void 0;if(o.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=a.to&&t.to>=a.to-10){var f,h=e.state.sliceDoc(t.from,t.to),p=n&&Yt(e,n.main.head);if(p){var d=t.insert.length-(t.to-t.from);f={from:p.from,to:p.to-d}}else f=e.state.doc.lineAt(a.head);var m=a.to-t.to,v=a.to-a.from;i=o.changeByRange((function(n){if(n.from==a.from&&n.to==a.to)return{changes:c,range:l||n.map(c)};var i=n.to-m,s=i-h.length;if(n.to-n.from!=v||e.state.sliceDoc(s,i)!=h||n.to>=f.from&&n.from<=f.to)return{range:n};var u=o.changes({from:s,to:i,insert:t.insert}),p=n.to-a.to;return{changes:u,range:l?r.f.range(Math.max(0,l.anchor+p),Math.max(0,l.head+p)):n.map(u)}}))}else i={changes:c,selection:l&&o.selection.replaceRange(l)}}var g="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,g+=".compose",e.inputState.compositionFirstChange&&(g+=".start",e.inputState.compositionFirstChange=!1)),o.update(i,{userEvent:g,scrollIntoView:!0})}var Sn=function(){function e(t){var n;_(this,e),this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,ve.safari&&t.contentDOM.addEventListener("input",(function(){return null})),ve.gecko&&(n=t.contentDOM.ownerDocument,Hn.has(n)||(Hn.add(n),n.addEventListener("copy",(function(){})),n.addEventListener("cut",(function(){}))))}return E(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"handleEvent",value:function(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=ee.get(r))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}},{key:"runHandlers",value:function(e,t){var n=this.handlers[e];if(n){var r,i=w(n.observers);try{for(i.s();!(r=i.n()).done;){(0,r.value)(this.view,t)}}catch(e){i.e(e)}finally{i.f()}var o,a=w(n.handlers);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}catch(e){a.e(e)}finally{a.f()}}}},{key:"ensureHandlers",value:function(e){var t=Pn(e),n=this.handlers,r=this.view.contentDOM;for(var i in t)if("scroll"!=i){var o=!t[i].handlers.length,a=n[i];a&&o!=!a.handlers.length&&(r.removeEventListener(i,this.handleEvent),a=null),a||r.addEventListener(i,this.handleEvent,{passive:o})}for(var s in n)"scroll"==s||t[s]||r.removeEventListener(s,this.handleEvent);this.handlers=t}},{key:"keydown",value:function(e){var t,n=this;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode)||(this.tabFocusMode>0&&27!=e.keyCode&&jn.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),!ve.android||!ve.chrome||e.synthetic||13!=e.keyCode&&8!=e.keyCode?!ve.ios||e.synthetic||e.altKey||e.metaKey||!((t=En.find((function(t){return t.keyCode==e.keyCode})))&&!e.ctrlKey||Tn.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((function(){return n.flushIOSKey()}),250),!0):(this.view.observer.delayAndroidKey(e.key,e.keyCode),!0))}},{key:"flushIOSKey",value:function(e){var t=this.pendingIOSKey;return!!t&&(!("Enter"==t.key&&e&&e.from0||!!(ve.safari&&!ve.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}},{key:"startMouseSelection",value:function(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}},{key:"update",value:function(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}();function _n(e,t){return function(n,r){try{return t.call(e,r,n)}catch(e){jt(n.state,e)}}}function Pn(e){var t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}var r,i=w(e);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.spec;if(a&&a.domEventHandlers)for(var s in a.domEventHandlers){var u=a.domEventHandlers[s];u&&n(s).handlers.push(_n(o.value,u))}if(a&&a.domEventObservers)for(var c in a.domEventObservers){var l=a.domEventObservers[c];l&&n(c).observers.push(_n(o.value,l))}}}catch(e){i.e(e)}finally{i.f()}for(var f in Rn)n(f).handlers.push(Rn[f]);for(var h in $n)n(h).observers.push($n[h]);return t}var En=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Tn="dthko",jn=[16,17,18,20,91,92,224,225];function Cn(e){return.7*Math.max(0,e)+8}var An=function(){function e(t,n,i,o){_(this,e),this.view=t,this.startEvent=n,this.style=i,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=function(e){for(var t,n,r=e.ownerDocument,i=e.parentNode;i&&!(i==r.body||t&&n);)if(1==i.nodeType)!n&&i.scrollHeight>i.clientHeight&&(n=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else{if(11!=i.nodeType)break;i=i.host}return{x:t,y:n}}(t.contentDOM),this.atoms=t.state.facet(Ft).map((function(e){return e(t)}));var a=t.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(r.g.allowMultipleSelections)&&function(e,t){var n=e.state.facet(dt);return n.length?n[0](t):ve.mac?t.metaKey:t.ctrlKey}(t,n),this.dragging=!(!function(e,t){var n=e.state.selection.main;if(n.empty)return!1;var r=j(e.root);if(!r||0==r.rangeCount)return!0;for(var i=r.getRangeAt(0).getClientRects(),o=0;o=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}(t,n)||1!=Zn(n))&&null}return E(e,[{key:"start",value:function(e){!1===this.dragging&&this.select(e)}},{key:"move",value:function(e){if(0==e.buttons)return this.destroy();if(!(this.dragging||null==this.dragging&&(t=this.startEvent,n=e,Math.max(Math.abs(t.clientX-n.clientX),Math.abs(t.clientY-n.clientY))<10))){var t,n;this.select(this.lastEvent=e);var r=0,i=0,o=0,a=0,s=this.view.win.innerWidth,u=this.view.win.innerHeight;if(this.scrollParents.x){var c=this.scrollParents.x.getBoundingClientRect();o=c.left,s=c.right}if(this.scrollParents.y){var l=this.scrollParents.y.getBoundingClientRect();a=l.top,u=l.bottom}var f=Ut(this.view);e.clientX-f.left<=o+6?r=-Cn(o-e.clientX):e.clientX+f.right>=s-6&&(r=Cn(e.clientX-s)),e.clientY-f.top<=a+6?i=-Cn(a-e.clientY):e.clientY+f.bottom>=u-6&&(i=Cn(e.clientY-u)),this.setScrollSpeed(r,i)}}},{key:"up",value:function(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){this.setScrollSpeed(0,0);var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}},{key:"setScrollSpeed",value:function(e,t){var n=this;this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((function(){return n.scroll()}),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}},{key:"scroll",value:function(){var e=this.scrollSpeed,t=e.x,n=e.y;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),!1===this.dragging&&this.select(this.lastEvent)}},{key:"skipAtoms",value:function(e){for(var t=null,n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=e.charCategorizer(t),o=e.doc.lineAt(t),a=t-o.from;if(0==o.length)return r.f.cursor(t);0==a?n=1:a==o.length&&(n=-1);var s=a,u=a;n<0?s=Object(r.v)(o.text,a,!1):u=Object(r.v)(o.text,a);for(var c=i(o.text.slice(s,u));s>0;){var l=Object(r.v)(o.text,s,!1);if(i(o.text.slice(l,s))!=c)break;s=l}for(;uDate.now()-2e3)return!1;var n,i=null,o=w(e.state.facet(vt));try{for(o.s();!(n=o.n()).done;){if(i=(0,n.value)(e,t))break}}catch(e){o.e(e)}finally{o.f()}if(i||0!=t.button||(i=function(e,t){var n=Ln(e,t),i=Zn(t),o=e.state.selection;return{update:function(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),o=o.map(e.changes))},get:function(t,a,s){var u,c=Ln(e,t),l=Dn(e,c.pos,c.bias,i);if(n.pos!=c.pos&&!a){var f=Dn(e,n.pos,n.bias,i),h=Math.min(f.from,l.from),p=Math.max(f.to,l.to);l=h1&&(u=function(e,t){for(var n=0;n=t)return r.f.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(o,c.pos))?u:s?o.addRange(l):r.f.create([l])}}}(e,t)),i){var a=!e.hasFocus;e.inputState.startMouseSelection(new An(e,t,i,a)),a&&e.observer.ignore((function(){B(e.contentDOM);var t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()}));var s=e.inputState.mouseSelection;if(s)return s.start(t),!1===s.dragging}return!1};var Nn=function(e,t,n){return t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right};function Fn(e,t,n,r){var i=De.find(e.docView,t);if(!i)return 1;var o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&Nn(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&Nn(n,r,s)?1:a&&a.bottom>=r?-1:1}function Ln(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:Fn(e,n,t.clientX,t.clientY)}}var qn=ve.ie&&ve.ie_version<=11,zn=null,Un=0,Bn=0;function Zn(e){if(!qn)return e.detail;var t=zn,n=Bn;return zn=e,Bn=Date.now(),Un=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Un+1)%3:1}function Vn(e,t,n,r){if(n=In(e.state,wt,n)){var i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.inputState.draggedContent,a=r&&o&&function(e,t){var n=e.state.facet(mt);return n.length?n[0](t):ve.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:o.from,to:o.to}:null,s={from:i,insert:n},u=e.state.changes(a?[a,s]:s);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}}Rn.dragstart=function(e,t){var n=e.state.selection.main;if(t.target.draggable){var i=e.docView.nearest(t.target);if(i&&i.isWidget){var o=i.posAtStart,a=o+i.length;(o>=n.to||a<=n.from)&&(n=r.f.range(o,a))}}var s=e.inputState;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",In(e.state,xt,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},Rn.dragend=function(e){return e.inputState.draggedContent=null,!1},Rn.drop=function(e,t){if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;var n=t.dataTransfer.files;if(n&&n.length){for(var r=Array(n.length),i=0,o=function(){++i==n.length&&Vn(e,t,r.filter((function(e){return null!=e})).join(e.state.lineBreak),!1)},a=function(e){var t=new FileReader;t.onerror=o,t.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])},s=0;su&&(n.push(f.text),r.push({from:f.from,to:Math.min(e.doc.length,f.to+1)})),u=f.number}}catch(e){c.e(e)}finally{c.f()}i=!0}return{text:In(e,xt,n.join(e.lineBreak)),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(!r&&!o)return!1;Wn=o?r:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});var a=Qn?null:t.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(function(e,t){var n=e.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((function(){r.remove(),e.focus()}),50)}}(e,r),!1)};var Xn=r.a.define();function Yn(e,t){var n,r=[],i=w(e.facet(Ot));try{for(i.s();!(n=i.n()).done;){var o=(0,n.value)(e,t);o&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r?e.update({effects:r,annotations:Xn.of(!0)}):null}function Gn(e){setTimeout((function(){var t=e.hasFocus;if(t!=e.inputState.notifiedFocused){var n=Yn(e.state,t);n?e.dispatch(n):e.update([])}}),10)}$n.focus=function(e){e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Gn(e)},$n.blur=function(e){e.observer.clearSelectionRange(),Gn(e)},$n.compositionstart=$n.compositionupdate=function(e){e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},$n.compositionend=function(e){e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,ve.chrome&&ve.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((function(){return e.observer.flush()})):setTimeout((function(){e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50))},$n.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()},Rn.beforeinput=function(e,t){var n,r,i;if("insertReplacementText"==t.inputType&&e.observer.editContext){var o=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),a=t.getTargetRanges();if(o&&a.length){var s=a[0],u=e.posAtDOM(s.startContainer,s.startOffset),c=e.posAtDOM(s.endContainer,s.endOffset);return xn(e,{from:u,to:c,insert:e.state.toText(o)},null),!0}}if(ve.chrome&&ve.android&&(i=En.find((function(e){return e.inputType==t.inputType})))&&(e.observer.delayAndroidKey(i.key,i.keyCode),"Backspace"==i.key||"Delete"==i.key)){var l=(null===(r=window.visualViewport)||void 0===r?void 0:r.height)||0;setTimeout((function(){var t;((null===(t=window.visualViewport)||void 0===t?void 0:t.height)||0)>l+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return ve.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),ve.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout((function(){return $n.compositionend(e,t)}),20),!1};var Hn=new Set;var Kn=["pre-wrap","normal","pre-line","break-spaces"],Jn=!1;function er(){Jn=!1}var tr=function(){function e(t){_(this,e),this.lineWrapping=t,this.doc=r.p.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}return E(e,[{key:"heightForGap",value:function(e,t){var n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}},{key:"heightForLine",value:function(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(e){return this.doc=e,this}},{key:"mustRefreshForWrapping",value:function(e){return Kn.indexOf(e)>-1!=this.lineWrapping}},{key:"mustRefreshForHeights",value:function(e){for(var t=!1,n=0;n-1,s=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:2;_(this,e),this.length=t,this.height=n,this.flags=r}return E(e,[{key:"outdated",get:function(){return(2&this.flags)>0},set:function(e){this.flags=(e?2:0)|-3&this.flags}},{key:"setHeight",value:function(e){this.height!=e&&(Math.abs(this.height-e)>or&&(Jn=!0),this.height=e)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,o=n.doc,a=r.length-1;a>=0;a--){var s=r[a],u=s.fromA,c=s.toA,l=s.fromB,f=s.toB,h=i.lineAt(u,ir.ByPosNoHeight,n.setDoc(t),0,0),p=h.to>=c?h:i.lineAt(c,ir.ByPosNoHeight,n,0,0);for(f+=p.to-c,c=p.to;a>0&&h.from<=r[a-1].toA;)u=r[a-1].fromA,l=r[a-1].fromB,a--,u2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i=i&&o(this.blockAt(0,n,r,i))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=t&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),t}(ar),cr=function(e){function t(e,n){var r;return _(this,t),(r=d(this,t,[e,n,null])).collapsed=0,r.widgetHeight=0,r.breaks=0,r}return y(t,e),E(t,[{key:"blockAt",value:function(e,t,n,r){return new rr(r,this.length,n,this.height,this.breaks)}},{key:"replace",value:function(e,n,r){var i=r[0];return 1==r.length&&(i instanceof t||i instanceof lr&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof lr?i=new t(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):ar.of(r)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),t}(ur),lr=function(e){function t(e){return _(this,t),d(this,t,[e,0])}return y(t,e),E(t,[{key:"heightMetrics",value:function(e,t){var n,r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,o=i-r+1,a=0;if(e.lineWrapping){var s=Math.min(this.height,e.lineHeight*o);n=s/o,this.length>o+1&&(a=(this.height-s)/(this.length-o-1))}else n=this.height/o;return{firstLine:r,lastLine:i,perLine:n,perChar:a}}},{key:"blockAt",value:function(e,t,n,r){var i=this.heightMetrics(t,r),o=i.firstLine,a=i.lastLine,s=i.perLine,u=i.perChar;if(t.lineWrapping){var c=r+(e0){var o=r[r.length-1];o instanceof t?r[r.length-1]=new t(o.length+i):r.push(null,new t(i-1))}if(e>0){var a=r[0];a instanceof t?r[0]=new t(e+a.length):r.unshift(new t(e-1),null)}return ar.of(r)}},{key:"decomposeLeft",value:function(e,n){n.push(new t(e-1),null)}},{key:"decomposeRight",value:function(e,n){n.push(null,new t(this.length-e-1))}},{key:"updateHeight",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=n+this.length;if(i&&i.from<=n+this.length&&i.more){var a=[],s=Math.max(n,i.from),u=-1;for(i.from>n&&a.push(new t(i.from-n-1).updateHeight(e,n));s<=o&&i.more;){var c=e.doc.lineAt(s).length;a.length&&a.push(null);var l=i.heights[i.index++];-1==u?u=l:Math.abs(l-u)>=or&&(u=-2);var f=new cr(c,l);f.outdated=!1,a.push(f),s+=c+1}s<=o&&a.push(null,new t(o-s).updateHeight(e,s));var h=ar.of(a);return(u<0||Math.abs(h.height-this.height)>=or||Math.abs(u-this.heightMetrics(e,n).perLine)>=or)&&(Jn=!0),sr(this,h)}return(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),t}(ar),fr=function(e){function t(e,n,r){var i;return _(this,t),(i=d(this,t,[e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)])).left=e,i.right=r,i.size=e.size+r.size,i}return y(t,e),E(t,[{key:"break",get:function(){return 1&this.flags}},{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return ea))return u;var c=t==ir.ByPosNoHeight?ir.ByPosNoHeight:ir.ByPos;return s?u.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,i).join(u)}},{key:"forEachLine",value:function(e,t,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,t,n,a,s,o);else{var u=this.lineAt(s,ir.ByPos,n,r,i);e=e&&u.from<=t&&o(u),t>u.to&&this.right.forEachLine(u.to+1,t,n,a,s,o)}}},{key:"replace",value:function(e,t,n){var r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));var i=[];e>0&&this.decomposeLeft(e,i);var o,a=i.length,s=w(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;i.push(u)}}catch(e){s.e(e)}finally{s.f()}if(e>0&&hr(i,a-1),t=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}},{key:"decomposeRight",value:function(e,t){var n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?ar.of(this.break?[e,null,t]:[e,t]):(this.left=sr(this.left,e),this.right=sr(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}}]),t}(ar);function hr(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof lr&&(r=e[t+1])instanceof lr&&e.splice(t-1,3,new lr(n.length+1+r.length))}var pr=function(){function e(t,n){_(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return E(e,[{key:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}},{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof cr?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new cr(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}},{key:"point",value:function(e,t,n){if(e=5)&&this.addLineDeco(r,i,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)){var e=this.oracle.doc.lineAt(this.pos),t=e.from,n=e.to;this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new cr(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new lr(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof cr)return e;var t=new cr(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine();var t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}},{key:"addLineDeco",value:function(e,t,n){var r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}},{key:"finish",value:function(e){var t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof cr||this.isCovered?(this.writtenTol.clientHeight||l.scrollWidth>l.clientWidth)&&"visible"!=f.overflow){var h=l.getBoundingClientRect();o=Math.max(o,h.left),a=Math.min(a,h.right),s=Math.max(s,h.top),u=Math.min(c==e.parentNode?i.innerHeight:u,h.bottom)}c="absolute"==f.position||"fixed"==f.position?l.offsetParent:l.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+t),bottom:Math.max(s,u)-(n.top+t)}}function gr(e,t){var n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var yr=function(){function e(t,n,r,i){_(this,e),this.from=t,this.to=n,this.size=r,this.displaySize=i}return E(e,[{key:"draw",value:function(e,t){return Ae.replace({widget:new br(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}],[{key:"same",value:function(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t&&r<=n}))){var o=e.lineBlockAt(r),a=o.from,s=o.to;t.push(new wr(a,s))}},i=0;i<=1;i++)r();return this.viewports=t.sort((function(e,t){return e.from-t.from})),this.updateScaler()}},{key:"updateScaler",value:function(){var e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Sr:new _r(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}},{key:"updateViewportLines",value:function(){var e=this;this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(function(t){e.viewportLines.push(Pr(t,e.scaler))}))}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.state=e.state;var n=this.stateDeco;this.stateDeco=this.state.facet(Dt).filter((function(e){return"function"!=typeof e}));var i=e.changedRanges,o=Zt.extendWithRanges(i,dr(n,this.stateDeco,e?e.changes:r.c.empty(this.state.doc.length))),a=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);er(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||Jn)&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);var u=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headu.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,t));var c=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(c||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(St)&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e){var t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,o=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?Ue.RTL:Ue.LTR;var a=this.heightOracle.mustRefreshForWrapping(o),s=t.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;var c=0,l=0;if(s.width&&s.height){var f=L(t,s),h=f.scaleX,p=f.scaleY;(h>.005&&Math.abs(this.scaleX-h)>.005||p>.005&&Math.abs(this.scaleY-p)>.005)&&(this.scaleX=h,this.scaleY=p,c|=8,a=u=!0)}var d=(parseInt(n.paddingTop)||0)*this.scaleY,m=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==d&&this.paddingBottom==m||(this.paddingTop=d,this.paddingBottom=m,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);var v=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=v&&(this.scrollAnchorHeight=-1,this.scrollTop=v),this.scrolledToBottom=Y(e.scrollDOM);var g=(this.printing?gr:vr)(t,this.paddingTop),y=g.top-this.pixelViewport.top,b=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;var O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(u=!0)),!this.inView&&!this.scrollTarget)return 0;var x=s.width;if(this.contentDOMWidth==x&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),u){var k=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(k)&&(a=!0),a||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){var S=e.docView.measureTextSize(),_=S.lineHeight,P=S.charWidth,E=S.textHeight;(a=_>0&&i.refresh(o,_,P,E,x/P,k))&&(e.docView.minWidth=0,c|=8)}y>0&&b>0?l=Math.max(y,b):y<0&&b<0&&(l=Math.min(y,b)),er();var T,j=w(this.viewports);try{for(j.s();!(T=j.n()).done;){var C=T.value,A=C.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(C);this.heightMap=(a?ar.empty().applyChanges(this.stateDeco,r.p.empty,this.heightOracle,[new Zt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new nr(C.from,A))}}catch(e){j.e(e)}finally{j.f()}Jn&&(c|=2)}var R=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return R&&(2&c&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(2&c||R)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}},{key:"visibleTop",get:function(){return this.scaler.fromDOM(this.pixelViewport.top)}},{key:"visibleBottom",get:function(){return this.scaler.fromDOM(this.pixelViewport.bottom)}},{key:"getViewport",value:function(e,t){var n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,o=this.visibleTop,a=this.visibleBottom,s=new wr(r.lineAt(o-1e3*n,ir.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),ir.ByHeight,i,0,0).to);if(t){var u=t.range.head;if(us.to){var c,l=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,ir.ByPos,i,0,0);c="center"==t.y?(f.top+f.bottom)/2-l/2:"start"==t.y||"nearest"==t.y&&u1&&void 0!==arguments[1]?arguments[1]:0;if(!this.inView)return!0;var i=this.heightMap.lineAt(t,ir.ByPos,this.heightOracle,0,0),o=i.top,a=this.heightMap.lineAt(n,ir.ByPos,this.heightOracle,0,0),s=a.bottom,u=this.visibleTop,c=this.visibleBottom;return(0==t||o<=u-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=c+Math.max(10,Math.min(r,250)))&&o>u-2e3&&s>1,s=o<<1;if(this.defaultTextDirection!=Ue.LTR&&!i)return[];var u,c=[],l=function o(s,u,l,f){if(!(u-ss&&v=l.from&&e.to<=l.to&&Math.abs(e.from-s)t}))}));if(!g){if(u=u}))){var y=t.moveToLineBoundary(r.f.cursor(u),!1,!0).head;y>s&&(u=y)}var b=n.gapSize(l,s,u,f);g=new yr(s,u,b,i||b<2e6?b:2e6)}c.push(g)}},f=function(t){if(!(t.lengtho&&(i.push({from:o,to:e}),a+=e-o),o=t}},20),o2e6){var O,x=w(e);try{for(x.s();!(O=x.n()).done;){var k=O.value;k.from>=t.from&&k.fromt.from&&l(t.from,u,t,a),c=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((function(t){return t.from<=e&&t.to>=e}))||Pr(this.heightMap.lineAt(e,ir.ByPos,this.heightOracle,0,0),this.scaler)}},{key:"lineBlockAtHeight",value:function(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((function(t){return t.top<=e&&t.bottom>=e}))||Pr(this.heightMap.lineAt(this.scaler.fromDOM(e),ir.ByHeight,this.heightOracle,0,0),this.scaler)}},{key:"scrollAnchorAt",value:function(e){var t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}},{key:"elementAtHeight",value:function(e){return Pr(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}},{key:"docHeight",get:function(){return this.scaler.toDOM(this.heightMap.height)}},{key:"contentHeight",get:function(){return this.docHeight+this.paddingTop+this.paddingBottom}}]),e}(),wr=E((function e(t,n){_(this,e),this.from=t,this.to=n}));function xr(e,t){var n=e.total,r=e.ranges;if(t<=0)return r[0].from;if(t>=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,u=a.to-s;if(i<=u)return s+i;i-=u}}function kr(e,t){var n,r=0,i=w(e.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(t<=s){r+=t-a;break}r+=s-a}}catch(e){i.e(e)}finally{i.f()}return r/e.total}var Sr={toDOM:function(e){return e},fromDOM:function(e){return e},scale:1,eq:function(e){return e==this}},_r=function(){function e(t,n,r){_(this,e);var i=0,o=0,a=0;this.viewports=r.map((function(e){var r=e.from,o=e.to,a=n.lineAt(r,ir.ByPos,t,0,0).top,s=n.lineAt(o,ir.ByPos,t,0,0).bottom;return i+=s-a,{from:r,to:o,top:a,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(n.height-i);var s,u=w(this.viewports);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.domTop=a+(c.top-o)*this.scale,a=c.domBottom=c.domTop+(c.bottom-c.top),o=c.bottom}}catch(e){u.e(e)}finally{u.f()}}return E(e,[{key:"toDOM",value:function(e){for(var t=0,n=0,r=0;;t++){var i=t-1}}),jr=i.a.newName(),Cr=i.a.newName(),Ar=i.a.newName(),Rr={"&light":"."+Cr,"&dark":"."+Ar};function $r(e,t,n){return new i.a(t,{finish:function(t){return/&/.test(t)?t.replace(/&\w*/,(function(t){if("&"==t)return e;if(!n||!n[t])throw new RangeError("Unsupported selector: ".concat(t));return n[t]})):e+" "+t}})}var Qr=$r("."+jr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Rr),Ir={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Mr=ve.ie&&ve.ie_version<=11,Dr=function(){function e(t){var n=this;_(this,e),this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new z,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var r,i=w(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.queue.push(o)}}catch(e){i.e(e)}finally{i.f()}(ve.ie&&ve.ie_version<=11||ve.ios&&t.composing)&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?n.flushSoon():n.flush()})),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||ve.chrome&&ve.chrome_version<126||(this.editContext=new Lr(t),t.state.facet(Ct)&&(t.contentDOM.editContext=this.editContext.editContext)),Mr&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((function(){var e;(null===(e=n.view.docView)||void 0===e?void 0:e.lastUpdate)0&&e[e.length-1].intersectionRatio>0!=n.intersecting&&(n.intersecting=!n.intersecting,n.intersecting!=n.view.inView&&n.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((function(e){e.length>0&&e[e.length-1].intersectionRatio>0&&n.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}return E(e,[{key:"onScrollChanged",value:function(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}},{key:"onScroll",value:function(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}},{key:"onResize",value:function(){var e=this;this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((function(){e.resizeTimeout=-1,e.view.requestMeasure()}),50))}},{key:"onPrint",value:function(e){var t=this;("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((function(){t.view.viewState.printing=!1,t.view.requestMeasure()}),500))}},{key:"updateGaps",value:function(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((function(t,n){return t!=e[n]})))){this.gapIntersection.disconnect();var t,n=w(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.gapIntersection.observe(r)}}catch(e){n.e(e)}finally{n.f()}this.gaps=e}}},{key:"onSelectionChange",value:function(e){var t=this.selectionChanged;if(this.readSelectionRange()&&!this.delayedAndroidKey){var n=this.view,r=this.selectionRange;if(n.state.facet(Ct)?n.root.activeElement==this.dom:A(this.dom,r)){var i=r.anchorNode&&n.docView.nearest(r.anchorNode);i&&i.ignoreEvent(e)?t||(this.selectionChanged=!1):(ve.ie&&ve.ie_version<=11||ve.android&&ve.chrome)&&!n.state.selection.main.empty&&r.focusNode&&$(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}}}},{key:"readSelectionRange",value:function(){var e=this.view,t=j(e.root);if(!t)return!1;var n=ve.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){var n=t.getComposedRanges(e.root)[0];if(n)return Fr(e,n)}var r=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),r=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),r?Fr(e,r):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;var r=A(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}},{key:"pendingRecords",value:function(){var e,t=w(this.observer.takeRecords());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.queue.push(n)}}catch(e){t.e(e)}finally{t.f()}return this.queue}},{key:"processRecords",value:function(){var e=this.pendingRecords();e.length&&(this.queue=[]);var t,n=-1,r=-1,i=!1,o=w(e);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=this.readMutation(a);s&&(s.typeOver&&(i=!0),-1==n?(n=s.from,r=s.to):(n=Math.min(s.from,n),r=Math.max(s.to,r)))}}catch(e){o.e(e)}finally{o.f()}return{from:n,to:r,typeOver:i}}},{key:"readChange",value:function(){var e=this.processRecords(),t=e.from,n=e.to,r=e.typeOver,i=this.selectionChanged&&A(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;var o=new On(this.view,t,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}},{key:"flush",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();var t=this.readChange();if(!t)return this.view.requestMeasure(),!1;var n=this.view.state,r=wn(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){var n=Nr(t,e.previousSibling||e.target.previousSibling,-1),r=Nr(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}},{key:"setWindow",value:function(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}},{key:"addWindowListeners",value:function(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}},{key:"removeWindowListeners",value:function(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"update",value:function(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ct)!=e.state.facet(Ct)&&(e.view.contentDOM.editContext=e.state.facet(Ct)?this.editContext.editContext:null))}},{key:"destroy",value:function(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();var r,i=w(this.scrollTargets);try{for(i.s();!(r=i.n()).done;){r.value.removeEventListener("scroll",this.onScroll)}}catch(e){i.e(e)}finally{i.f()}this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}]),e}();function Nr(e,t,n){for(;t;){var r=ee.get(t);if(r&&r.parent==e)return r;var i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function Fr(e,t){var n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);if($(a.node,a.offset,i,o)){var s=[i,o,n,r];n=s[0],r=s[1],i=s[2],o=s[3]}return{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}var Lr=function(){function e(t){var n=this;_(this,e),this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(t.state);var i=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});for(var o in this.handlers.textupdate=function(e){var i=t.state.selection.main.anchor,o={from:n.toEditorPos(e.updateRangeStart),to:n.toEditorPos(e.updateRangeEnd),insert:r.p.of(e.text.split("\n"))};o.from==n.from&&in.to&&(o.to=i),(o.from!=o.to||o.insert.length)&&(n.pendingContextChange=o,t.state.readOnly||xn(t,o,r.f.single(n.toEditorPos(e.selectionStart),n.toEditorPos(e.selectionEnd))),n.pendingContextChange&&(n.revertPending(t.state),n.setSelection(t.state)))},this.handlers.characterboundsupdate=function(e){for(var r=[],o=null,a=n.toEditorPos(e.rangeStart),s=n.toEditorPos(e.rangeEnd);a=i.to){if(i.from==o&&i.to==a&&i.insert.eq(c))return i=t.pendingContextChange=null,n+=l,void(t.to+=l);i=null,t.revertPending(e.state)}if(o+=n,(a+=n)<=t.from)t.from+=l,t.to+=l;else if(ot.to||t.to-t.from+c.length>3e4)return void(r=!0);t.editContext.updateText(t.toContextPos(o),t.toContextPos(a),c.toString()),t.to+=l}n+=l}})),i&&!r&&this.revertPending(e.state),!r}},{key:"update",value:function(e){var t=this.pendingContextChange;this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}},{key:"resetRange",value:function(e){var t=e.selection.main.head;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}},{key:"revertPending",value:function(e){var t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}},{key:"setSelection",value:function(e){var t=e.selection.main,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==r||this.editContext.updateSelection(n,r)}},{key:"rangeIsValid",value:function(e){var t=e.selection.main.head;return!(this.from>0&&t-this.from<500||this.to3e4)}},{key:"toEditorPos",value:function(e){return e+this.from}},{key:"toContextPos",value:function(e){return e-this.from}},{key:"destroy",value:function(){for(var e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}]),e}(),qr=function(){function e(){var t,n=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_(this,e),this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),i.parent&&i.parent.appendChild(this.dom);var o=i.dispatch;this.dispatchTransactions=i.dispatchTransactions||o&&function(e){return e.forEach((function(e){return o(e,n)}))}||function(e){return n.update(e)},this.dispatch=this.dispatch.bind(this),this._root=i.root||W(i.parent)||document,this.viewState=new Or(i.state||r.g.create(i)),i.scrollTo&&i.scrollTo.is(Et)&&(this.viewState.scrollTarget=i.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Rt).map((function(e){return new Qt(e)}));var a,s=w(this.plugins);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.update(this)}}catch(e){s.e(e)}finally{s.f()}this.observer=new Dr(this),this.inputState=new Sn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Wt(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then((function(){return n.requestMeasure()}))}return E(e,[{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"compositionStarted",get:function(){return this.inputState.composing>=0}},{key:"root",get:function(){return this._root}},{key:"win",get:function(){return this.dom.ownerDocument.defaultView||window}},{key:"dispatch",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;ib.anchor?-1:1))}var O,x=w(y.effects);try{for(x.s();!(O=x.n()).done;){var k=O.value;k.is(Et)&&(m=k.value.clip(this.state))}}catch(e){x.e(e)}finally{x.f()}}}catch(e){g.e(e)}finally{g.f()}this.viewState.update(n,m),this.bidiCache=Br.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),o=this.docView.update(n),this.state.facet(Bt)!=this.styleModules&&this.mountStyles(),a=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(o,e.some((function(e){return e.isUserEvent("select.pointer")})))}finally{this.updateState=0}if(n.startState.facet(Er)!=n.state.facet(Er)&&(this.viewState.mustMeasureContent=!0),(o||a||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),o&&this.docViewUpdate(),!n.empty){var S,_=w(this.state.facet(yt));try{for(_.s();!(S=_.n()).done;){var P=S.value;try{P(n)}catch(k){jt(this.state,k,"update listener")}}}catch(e){_.e(e)}finally{_.f()}}(h||d)&&Promise.resolve().then((function(){h&&t.state==h.startState&&t.dispatch(h),d&&!wn(t,d)&&p.force&&V(t.contentDOM,p.key,p.keyCode)}))}}},{key:"setState",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)this.viewState.state=e;else{this.updateState=2;var t=this.hasFocus;try{var n,r=w(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(e){r.e(e)}finally{r.f()}this.viewState=new Or(e),this.plugins=e.facet(Rt).map((function(e){return new Qt(e)})),this.pluginMap.clear();var i,o=w(this.plugins);try{for(o.s();!(i=o.n()).done;){i.value.update(this)}}catch(e){o.e(e)}finally{o.f()}this.docView.destroy(),this.docView=new Wt(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}}},{key:"updatePlugins",value:function(e){var t=e.startState.facet(Rt),n=e.state.facet(Rt);if(t!=n){var r,i=[],o=w(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=t.indexOf(a);if(s<0)i.push(new Qt(a));else{var u=this.plugins[s];u.mustUpdate=e,i.push(u)}}}catch(e){o.e(e)}finally{o.f()}var c,l=w(this.plugins);try{for(l.s();!(c=l.n()).done;){var f=c.value;f.mustUpdate!=e&&f.destroy(this)}}catch(e){l.e(e)}finally{l.f()}this.plugins=i,this.pluginMap.clear()}else{var h,p=w(this.plugins);try{for(p.s();!(h=p.n()).done;){h.value.mustUpdate=e}}catch(e){p.e(e)}finally{p.f()}}for(var d=0;d0&&void 0!==arguments[0])||arguments[0];if(!this.destroyed){if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();var n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,o=this.viewState,a=o.scrollAnchorPos,s=o.scrollAnchorHeight;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(var u=0;;u++){if(s<0)if(Y(r))a=-1,s=this.viewState.heightMap.height;else{var c=this.viewState.scrollAnchorAt(i);a=c.from,s=c.top}this.updateState=1;var l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(u>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}var f=[];if(!(4&l)){var h=[f,this.measureRequests];this.measureRequests=h[0],f=h[1]}var p=f.map((function(t){try{return t.read(e)}catch(t){return jt(e.state,t),Ur}})),d=Vt.create(this,this.state,[]),m=!1;d.flags|=l,n?n.flags|=l:n=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),(m=this.docView.update(d))&&this.docViewUpdate());for(var v=0;v1||b<-1){i+=b,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty){var O,x=w(this.state.facet(yt));try{for(x.s();!(O=x.n()).done;){var k=O.value;k(n)}}catch(e){x.e(e)}finally{x.f()}}}}},{key:"themeClasses",get:function(){return jr+" "+(this.state.facet(Tr)?Ar:Cr)+" "+this.state.facet(Er)}},{key:"updateAttrs",value:function(){var e=this,t=Zr(this,It,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Ct)?"true":"false",class:"cm-content",style:"".concat(ve.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Zr(this,Mt,n);var r=this.observer.ignore((function(){var r=Ee(e.contentDOM,e.contentAttrs,n),i=Ee(e.dom,e.editorAttrs,t);return r||i}));return this.editorAttrs=t,this.contentAttrs=n,r}},{key:"showAnnouncements",value:function(t){var n,r=!0,i=w(t);try{for(i.s();!(n=i.n()).done;){var o,a=w(n.value.effects);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.is(e.announce))r&&(this.announceDOM.textContent=""),r=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=s.value}}catch(e){a.e(e)}finally{a.f()}}}catch(e){i.e(e)}finally{i.f()}}},{key:"mountStyles",value:function(){this.styleModules=this.state.facet(Bt);var t=this.state.facet(e.cspNonce);i.a.mount(this.root,this.styleModules.concat(Qr).reverse(),t?{nonce:t}:void 0)}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}},{key:"requestMeasure",value:function(e){var t=this;if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((function(){return t.measure()}))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(var n=0;n2&&void 0!==arguments[2])||arguments[2];return hn(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return mn(this,e,function(e,t,n,i){var o=t.head,a=n?1:-1;if(o==(n?e.state.doc.length:0))return r.f.cursor(o,t.assoc);var s,u=t.goalColumn,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(o,t.assoc||-1),f=e.documentTop;if(l)null==u&&(u=l.left-c.left),s=a<0?l.top:l.bottom;else{var h=e.viewState.lineBlockAt(o);null==u&&(u=Math.min(c.right-c.left,e.defaultCharacterWidth*(o-h.from))),s=(a<0?h.top:h.bottom)+f}for(var p=c.left+u,d=null!=i?i:e.viewState.heightOracle.textHeight>>1,m=0;;m+=10){var v=s+(d+m)*a,g=sn(e,{x:p,y:v},!1,a);if(vc.bottom||(a<0?go)){var y=e.docView.coordsForChar(g),b=!y||v1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"posAtCoords",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.readMeasured(),sn(this,e,t)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(e),i=this.bidiSpans(r),o=i[it.find(i,e-r.from,-1,t)];return N(n,o.dir==Ue.LTR==t>0)}},{key:"coordsForChar",value:function(e){return this.readMeasured(),this.docView.coordsForChar(e)}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.defaultTextDirection}},{key:"textDirectionAt",value:function(e){return!this.state.facet(kt)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"bidiSpans",value:function(e){if(e.length>zr)return lt(e.length);var t,n,r=this.textDirectionAt(e.from),i=w(this.bidiCache);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.from==e.from&&o.dir==r&&(o.fresh||ot(o.isolates,t=qt(this,e))))return o.order}}catch(e){i.e(e)}finally{i.f()}t||(t=qt(this,e));var a=ct(e.text,r,t);return this.bidiCache.push(new Br(e.from,e.to,r,t,!0,a)),a}},{key:"hasFocus",get:function(){var e;return(this.dom.ownerDocument.hasFocus()||ve.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){B(e.contentDOM),e.docView.updateSelection()}))}},{key:"setRoot",value:function(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}},{key:"destroy",value:function(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();var e,t=w(this.plugins);try{for(t.s();!(e=t.n()).done;){e.value.destroy(this)}}catch(e){t.e(e)}finally{t.f()}this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}},{key:"scrollSnapshot",value:function(){var e=this.scrollDOM,t=e.scrollTop,n=e.scrollLeft,i=this.viewState.scrollAnchorAt(t);return Et.of(new Pt(r.f.cursor(i.from),"start","start",i.top-t,n,!0))}},{key:"setTabFocusMode",value:function(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}}],[{key:"scrollIntoView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Et.of(new Pt("number"==typeof e?r.f.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}},{key:"domEventHandlers",value:function(e){return $t.define((function(){return{}}),{eventHandlers:e})}},{key:"domEventObservers",value:function(e){return $t.define((function(){return{}}),{eventObservers:e})}},{key:"theme",value:function(e,t){var n=i.a.newName(),r=[Er.of(n),Bt.of($r(".".concat(n),e))];return t&&t.dark&&r.push(Tr.of(!0)),r}},{key:"baseTheme",value:function(e){return r.j.lowest(Bt.of($r("."+jr,e,Rr)))}},{key:"findFromDOM",value:function(e){var t,n=e.querySelector(".cm-content"),r=n&&ee.get(n)||ee.get(e);return(null===(t=null==r?void 0:r.rootView)||void 0===t?void 0:t.view)||null}}]),e}();qr.styleModule=Bt,qr.inputHandler=bt,qr.clipboardInputFilter=wt,qr.clipboardOutputFilter=xt,qr.scrollHandler=_t,qr.focusChangeEffect=Ot,qr.perLineTextDirection=kt,qr.exceptionSink=gt,qr.updateListener=yt,qr.editable=Ct,qr.mouseSelectionStyle=vt,qr.dragMovesSelection=mt,qr.clickAddsSelectionRange=dt,qr.decorations=Dt,qr.outerDecorations=Nt,qr.atomicRanges=Ft,qr.bidiIsolatedRanges=Lt,qr.scrollMargins=zt,qr.darkTheme=Tr,qr.cspNonce=r.h.define({combine:function(e){return e.length?e[0]:""}}),qr.contentAttributes=Mt,qr.editorAttributes=It,qr.lineWrapping=qr.contentAttributes.of({class:"cm-lineWrapping"}),qr.announce=r.n.define();var zr=4096,Ur={},Br=function(){function e(t,n,r,i,o,a){_(this,e),this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=a}return E(e,null,[{key:"update",value:function(t,n){if(n.empty&&!t.some((function(e){return e.fresh})))return t;for(var r=[],i=t.length?t[t.length-1].dir:Ue.LTR,o=Math.max(0,t.length-10);o=0;i--){var o=r[i],a="function"==typeof o?o(e):o;a&&Se(a,n)}return n}var Vr=ve.mac?"mac":ve.windows?"win":ve.linux?"linux":"key";function Wr(e,t){var n,r,i,o,a=e.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:Vr,r=Object.create(null),i=Object.create(null),o=function(e,t){var n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},a=function(e,t,i,a,s){for(var u,c,l=r[e]||(r[e]=Object.create(null)),f=t.split(/ (?!$)/).map((function(e){return Wr(e,n)})),h=function(){var t=f.slice(0,p).join(" ");o(t,!0),l[t]||(l[t]={preventDefault:!0,stopPropagation:!1,run:[function(n){var r=ei={view:n,prefix:t,scope:e};return setTimeout((function(){ei==r&&(ei=null)}),ti),!0}]})},p=1;p=e.viewport.to)return[];var r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==Ue.LTR,a=e.contentDOM,s=a.getBoundingClientRect(),u=oi(e),c=a.querySelector(".cm-line"),l=c&&window.getComputedStyle(c),f=s.left+(l?parseInt(l.paddingLeft)+Math.min(0,parseInt(l.textIndent)):0),h=s.right-(l?parseInt(l.paddingRight):0),p=fn(e,r),d=fn(e,i),m=p.type==Ce.Text?p:null,v=d.type==Ce.Text?d:null;if(m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=ai(e,r,1,m)),v&&(e.lineWrapping||d.widgetLineBreaks)&&(v=ai(e,i,-1,v)),m&&v&&m.from==v.from&&m.to==v.to)return x(k(n.from,n.to,m));var g=m?k(n.from,null,m):S(p,!1),y=v?k(null,n.to,v):S(d,!0),b=[];return(m||p).to<(v||d).from-(m&&v?1:0)||p.widgetLineBreaks>1&&g.bottom+e.defaultLineHeight/2l&&m.from=g)break;S>v&&u(Math.max(k,v),null==t&&k<=l,Math.min(S,g),null==n&&S>=p,x.dir)}}catch(e){O.e(e)}finally{O.f()}if((v=b.to+1)>=g)break}}}catch(e){d.e(e)}finally{d.f()}return 0==s.length&&u(l,null==t,p,null==n,e.textDirection),{top:i,bottom:a,horizontal:s}}function S(e,t){var n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}var ui=function(){function e(t,n){_(this,e),this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}return E(e,[{key:"update",value:function(e){e.startState.facet(ci)!=e.state.facet(ci)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}},{key:"docViewUpdate",value:function(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}},{key:"setOrder",value:function(e){for(var t=0,n=e.facet(ci);t0&&void 0!==arguments[0]?arguments[0]:{};return[hi.of(e),vi,yi,Oi,St.of(!0)]}function di(e){return e.facet(hi)}function mi(e){return e.startState.facet(hi)!=e.state.facet(hi)}var vi=li({above:!0,markers:function(e){var t,n=e.state,i=n.facet(hi),o=[],a=w(n.selection.ranges);try{for(a.s();!(t=a.n()).done;){var s=t.value,u=s==n.selection.main;if(s.empty?!u||fi:i.drawRangeCursor){var c,l=u?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",f=s.empty?s:r.f.cursor(s.head,s.head>s.anchor?-1:1),h=w(ii.forRange(e,l,f));try{for(h.s();!(c=h.n()).done;){var p=c.value;o.push(p)}}catch(e){h.e(e)}finally{h.f()}}}}catch(e){a.e(e)}finally{a.f()}return o},update:function(e,t){e.transactions.some((function(e){return e.selection}))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");var n=mi(e);return n&&gi(e.state,t),e.docChanged||e.selectionSet||n},mount:function(e,t){gi(t.state,e)},class:"cm-cursorLayer"});function gi(e,t){t.style.animationDuration=e.facet(hi).cursorBlinkRate+"ms"}var yi=li({above:!1,markers:function(e){return e.state.selection.ranges.map((function(t){return t.empty?[]:ii.forRange(e,"cm-selectionBackground",t)})).reduce((function(e,t){return e.concat(t)}))},update:function(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||mi(e)},class:"cm-selectionLayer"}),bi={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};fi&&(bi[".cm-line"].caretColor=bi[".cm-content"].caretColor="transparent !important");var Oi=r.j.highest(qr.theme(bi)),wi=r.n.define({map:function(e,t){return null==e?null:t.mapPos(e)}}),xi=r.o.define({create:function(){return null},update:function(e,t){return null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((function(e,t){return t.is(wi)?t.value:e}),e)}}),ki=$t.fromClass(function(){function e(t){_(this,e),this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}return E(e,[{key:"update",value:function(e){var t,n=e.state.field(xi);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(xi)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}},{key:"readPos",value:function(){var e=this.view,t=e.state.field(xi),n=null!=t&&e.coordsAtPos(t);if(!n)return null;var r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}},{key:"drawCursor",value:function(e){if(this.cursor){var t=this.view,n=t.scaleX,r=t.scaleY;e?(this.cursor.style.left=e.left/n+"px",this.cursor.style.top=e.top/r+"px",this.cursor.style.height=e.height/r+"px"):this.cursor.style.left="-100000px"}}},{key:"destroy",value:function(){this.cursor&&this.cursor.remove()}},{key:"setDropPos",value:function(e){this.view.state.field(xi)!=e&&this.view.dispatch({effects:wi.of(e)})}}]),e}(),{eventObservers:{dragover:function(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave:function(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend:function(){this.setDropPos(null)},drop:function(){this.setDropPos(null)}}});function Si(){return[xi,ki]}function _i(e,t,n,r,i){t.lastIndex=0;for(var o,a=e.iterRange(n,r),s=n;!a.next().done;s+=a.value.length)if(!a.lineBreak)for(;o=t.exec(a.value);)i(s+o.index,o)}var Pi=function(){function e(t){_(this,e);var n=t.regexp,r=t.decoration,i=t.decorate,o=t.boundary,a=t.maxLength,s=void 0===a?1e3:a;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=function(e,t,n,r){return i(r,n,n+e[0].length,e,t)};else if("function"==typeof r)this.addMatch=function(e,t,n,i){var o=r(e,t,n);o&&i(n,n+e[0].length,o)};else{if(!r)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=function(e,t,n,i){return i(n,n+e[0].length,r)}}this.boundary=o,this.maxLength=s}return E(e,[{key:"createDeco",value:function(e){var t,n=this,i=new r.l,o=i.add.bind(i),a=w(function(e,t){var n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;var r,i=[],o=w(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.from,u=a.to;s=Math.max(e.state.doc.lineAt(s).from,s-t),u=Math.min(e.state.doc.lineAt(u).to,u+t),i.length&&i[i.length-1].to>=s?i[i.length-1].to=u:i.push({from:s,to:u})}}catch(e){o.e(e)}finally{o.f()}return i}(e,this.maxLength));try{for(a.s();!(t=a.n()).done;){var s=t.value,u=s.from,c=s.to;_i(e.state.doc,this.regexp,u,c,(function(t,r){return n.addMatch(r,e,t,o)}))}}catch(e){a.e(e)}finally{a.f()}return i.finish()}},{key:"updateDeco",value:function(e,t){var n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((function(t,i,o,a){a>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}},{key:"updateRange",value:function(e,t,n,r){var i,o=this,a=w(e.visibleRanges);try{var s=function(){var a=i.value,s=Math.max(a.from,n),u=Math.min(a.to,r);if(u>s){var c=e.state.doc.lineAt(s),l=c.toc.from;s--)if(o.boundary.test(c.text[s-1-c.from])){f=s;break}for(;uh},add:d})}};for(a.s();!(i=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return t}}]),e}(),Ei=null!=/x/.unicode?"gu":"g",Ti=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Ei),ji={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Ci=null;var Ai=r.h.define({combine:function(e){var t=Object(r.t)(e,{render:null,specialChars:Ti,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==Ci&&"undefined"!=typeof document&&document.body){var t=document.body.style;Ci=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return Ci||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,Ei)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Ei)),t}});function Ri(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[Ai.of(e),Qi()]}var $i=null;function Qi(){return $i||($i=$t.fromClass(function(){function e(t){_(this,e),this.view=t,this.decorations=Ae.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Ai)),this.decorations=this.decorator.createDeco(t)}return E(e,[{key:"makeDecorator",value:function(e){var t=this;return new Pi({regexp:e.specialChars,decoration:function(n,i,o){var a=i.state.doc,s=Object(r.r)(n[0],0);if(9==s){var u=a.lineAt(o),c=i.state.tabSize,l=Object(r.u)(u.text,c,o-u.from);return Ae.replace({widget:new Mi((c-l%c)*t.view.defaultCharacterWidth/t.view.scaleX)})}return t.decorationCache[s]||(t.decorationCache[s]=Ae.replace({widget:new Ii(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}},{key:"update",value:function(e){var t=e.state.facet(Ai);e.startState.facet(Ai)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}}]),e}(),{decorations:function(e){return e.decorations}}))}var Ii=function(e){function t(e,n){var r;return _(this,t),(r=d(this,t)).options=e,r.code=n,r}return y(t,e),E(t,[{key:"eq",value:function(e){return e.code==this.code}},{key:"toDOM",value:function(e){var t,n=(t=this.code)>=32?"•":10==t?"␤":String.fromCharCode(9216+t),r=e.state.phrase("Control character")+" "+(ji[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;var o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}},{key:"ignoreEvent",value:function(){return!1}}]),t}(je),Mi=function(e){function t(e){var n;return _(this,t),(n=d(this,t)).width=e,n}return y(t,e),E(t,[{key:"eq",value:function(e){return e.width==this.width}},{key:"toDOM",value:function(){var e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),t}(je),Di=$t.fromClass(function(){function e(){_(this,e),this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}return E(e,[{key:"update",value:function(e){var t=e.view,n=t.viewState.editorHeight-t.defaultLineHeight-t.documentPadding.top-.5;n>=0&&n!=this.height&&(this.height=n,this.attrs={style:"padding-bottom: ".concat(n,"px")})}}]),e}());function Ni(){return[Di,Mt.of((function(e){var t;return(null===(t=e.plugin(Di))||void 0===t?void 0:t.attrs)||null}))]}function Fi(){return qi}var Li=Ae.line({class:"cm-activeLine"}),qi=$t.fromClass(function(){function e(t){_(this,e),this.decorations=this.getDeco(t)}return E(e,[{key:"update",value:function(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t,n=-1,r=[],i=w(e.state.selection.ranges);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=e.lineBlockAt(o.head);a.from>n&&(r.push(Li.range(a.from)),n=a.from)}}catch(e){i.e(e)}finally{i.f()}return Ae.set(r)}}]),e}(),{decorations:function(e){return e.decorations}});var zi=2e3;function Ui(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),o=n-i.from,a=o>zi?-1:o==i.length?function(e,t){var n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):Object(r.u)(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:a,off:o}}function Bi(e,t){var n=Ui(e,t),i=e.state.selection;return n?{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(e.changes)}},get:function(t,o,a){var s=Ui(e,t);if(!s)return i;var u=function(e,t,n){var i=Math.min(t.line,n.line),o=Math.max(t.line,n.line),a=[];if(t.off>zi||n.off>zi||t.col<0||n.col<0)for(var s=Math.min(t.off,n.off),u=Math.max(t.off,n.off),c=i;c<=o;c++){var l=e.doc.line(c);l.length<=u&&a.push(r.f.range(l.from+s,l.to+u))}else for(var f=Math.min(t.col,n.col),h=Math.max(t.col,n.col),p=i;p<=o;p++){var d=e.doc.line(p),m=Object(r.w)(d.text,f,e.tabSize,!0);if(m<0)a.push(r.f.cursor(d.to));else{var v=Object(r.w)(d.text,h,e.tabSize);a.push(r.f.range(d.from+m,d.from+v))}}return a}(e.state,n,s);return u.length?a?r.f.create(u.concat(i.ranges)):r.f.create(u):i}}:null}function Zi(e){var t=(null==e?void 0:e.eventFilter)||function(e){return e.altKey&&0==e.button};return qr.mouseSelectionStyle.of((function(e,n){return t(n)?Bi(e,n):null}))}var Vi={Alt:[18,function(e){return!!e.altKey}],Control:[17,function(e){return!!e.ctrlKey}],Shift:[16,function(e){return!!e.shiftKey}],Meta:[91,function(e){return!!e.metaKey}]},Wi={style:"cursor: crosshair"};function Xi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=f(Vi[e.key||"Alt"],2),n=t[0],r=t[1],i=$t.fromClass(function(){function e(t){_(this,e),this.view=t,this.isDown=!1}return E(e,[{key:"set",value:function(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}}]),e}(),{eventObservers:{keydown:function(e){this.set(e.keyCode==n||r(e))},keyup:function(e){e.keyCode!=n&&r(e)||this.set(!1)},mousemove:function(e){this.set(r(e))}}});return[i,qr.contentAttributes.of((function(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.isDown)?Wi:null}))]}var Yi="-10000px",Gi=function(){function e(t,n,r,i){_(this,e),this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter((function(e){return e}));var o=null;this.tooltipViews=this.tooltips.map((function(e){return o=r(e,o)}))}return E(e,[{key:"update",value:function(e,t){var n,r=e.state.facet(this.facet),i=r.filter((function(e){return e}));if(r===this.input){var o,a=w(this.tooltipViews);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.update&&s.update(e)}}catch(e){a.e(e)}finally{a.f()}return!1}for(var u=[],c=t?[]:null,l=0;ln.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&n.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}return E(e,[{key:"createContainer",value:function(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}},{key:"observeIntersection",value:function(){if(this.intersectionObserver){this.intersectionObserver.disconnect();var e,t=w(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.intersectionObserver.observe(n.dom)}}catch(e){t.e(e)}finally{t.f()}}}},{key:"measureSoon",value:function(){var e=this;this.measureTimeout<0&&(this.measureTimeout=setTimeout((function(){e.measureTimeout=-1,e.maybeMeasure()}),50))}},{key:"update",value:function(e){e.transactions.length&&(this.lastTransaction=Date.now());var t=this.manager.update(e,this.above);t&&this.observeIntersection();var n=t||e.geometryChanged,r=e.state.facet(Ki);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;var i,o=w(this.manager.tooltipViews);try{for(o.s();!(i=o.n()).done;){i.value.dom.style.position=this.position}}catch(e){o.e(e)}finally{o.f()}n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();var a,s=w(this.manager.tooltipViews);try{for(s.s();!(a=s.n()).done;){var u=a.value;this.container.appendChild(u.dom)}}catch(e){s.e(e)}finally{s.f()}n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}},{key:"createTooltip",value:function(e,t){var n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){var i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Yi,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}},{key:"destroy",value:function(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);var r,i=w(this.manager.tooltipViews);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.dom.remove(),null===(e=o.destroy)||void 0===e||e.call(o)}}catch(e){i.e(e)}finally{i.f()}this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}},{key:"readMeasure",value:function(){var e=this,t=this.view.dom.getBoundingClientRect(),n=1,r=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){var o=this.manager.tooltipViews[0].dom;if(ve.gecko)i=o.offsetParent!=this.container.ownerDocument.body;else if(o.style.top==Yi&&"0px"==o.style.left){var a=o.getBoundingClientRect();i=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}}if(i||"absolute"==this.position)if(this.parent){var s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,r=s.height/this.parent.offsetHeight)}else{var u=this.view.viewState;n=u.scaleX,r=u.scaleY}return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((function(t,n){var r=e.manager.tooltipViews[n];return r.getCoords?r.getCoords(t.pos):e.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((function(e){return e.dom.getBoundingClientRect()})),space:this.view.state.facet(Ki).tooltipSpace(this.view),scaleX:n,scaleY:r,makeAbsolute:i}}},{key:"writeMeasure",value:function(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";var n,r=w(this.manager.tooltipViews);try{for(r.s();!(n=r.n()).done;){n.value.dom.style.position="absolute"}}catch(e){r.e(e)}finally{r.f()}}for(var i=e.editor,o=e.space,a=e.scaleX,s=e.scaleY,u=[],c=0;c=Math.min(i.bottom,o.bottom)||p.rightMath.min(i.right,o.right)+.1)h.style.top=Yi;else{var m=l.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,v=m?7:0,g=d.right-d.left,y=null!==(t=Ji.get(f))&&void 0!==t?t:d.bottom-d.top,b=f.offset||no,O=this.view.textDirection==Ue.LTR,x=d.width>o.right-o.left?O?o.left:o.right-d.width:O?Math.max(o.left,Math.min(p.left-(m?14:0)+b.x,o.right-g)):Math.min(Math.max(o.left,p.left-g+(m?14:0)-b.x),o.right-g),k=this.above[c];!l.strictSide&&(k?p.top-(d.bottom-d.top)-b.yo.bottom)&&k==o.bottom-p.bottom>p.top-o.top&&(k=this.above[c]=!k);var S=(k?p.top-o.top:o.bottom-p.bottom)-v;if(Sx&&j.top<_+y&&j.bottom>_&&(_=k?j.top-y-2-v:j.bottom+v+2)}}catch(e){T.e(e)}finally{T.f()}}if("absolute"==this.position?(h.style.top=(_-e.parent.top)/s+"px",h.style.left=(x-e.parent.left)/a+"px"):(h.style.top=_/s+"px",h.style.left=x/a+"px"),m){var C=p.left+(O?b.x:-b.x)-(x+14-7);m.style.left=C/a+"px"}!0!==f.overlap&&u.push({left:x,top:_,right:P,bottom:_+y}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),f.positioned&&f.positioned(e.space)}}}},{key:"maybeMeasure",value:function(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var e,t=w(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){e.value.dom.style.top=Yi}}catch(e){t.e(e)}finally{t.f()}}}}]),e}(),{eventObservers:{scroll:function(){this.maybeMeasure()}}}),to=qr.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"".concat(7,"px"),width:"".concat(14,"px"),position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"".concat(7,"px solid transparent"),borderRight:"".concat(7,"px solid transparent")},".cm-tooltip-above &":{bottom:"-".concat(7,"px"),"&:before":{borderTop:"".concat(7,"px solid #bbb")},"&:after":{borderTop:"".concat(7,"px solid #f5f5f5"),bottom:"1px"}},".cm-tooltip-below &":{top:"-".concat(7,"px"),"&:before":{borderBottom:"".concat(7,"px solid #bbb")},"&:after":{borderBottom:"".concat(7,"px solid #f5f5f5"),top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),no={x:0,y:0},ro=r.h.define({enables:[eo,to]});function io(e,t){var n=e.plugin(eo);if(!n)return null;var r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var oo=r.h.define({combine:function(e){var t,n,r,i=w(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;t=t||o.topContainer,n=n||o.bottomContainer}}catch(e){i.e(e)}finally{i.f()}return{topContainer:t,bottomContainer:n}}});function ao(e,t){var n=e.plugin(so),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var so=$t.fromClass(function(){function e(t){_(this,e),this.input=t.state.facet(lo),this.specs=this.input.filter((function(e){return e})),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(oo);this.top=new uo(t,!0,n.topContainer),this.bottom=new uo(t,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(e){return e.top}))),this.bottom.sync(this.panels.filter((function(e){return!e.top})));var r,i=w(this.panels);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.dom.classList.add("cm-panel"),o.mount&&o.mount()}}catch(e){i.e(e)}finally{i.f()}}return E(e,[{key:"update",value:function(e){var t=e.state.facet(oo);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new uo(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new uo(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(lo);if(n!=this.input){var r,i=n.filter((function(e){return e})),o=[],a=[],s=[],u=[],c=w(i);try{for(c.s();!(r=c.n()).done;){var l=r.value,f=this.specs.indexOf(l),h=void 0;f<0?(h=l(e.view),u.push(h)):(h=this.panels[f]).update&&h.update(e),o.push(h),(h.top?a:s).push(h)}}catch(e){c.e(e)}finally{c.f()}this.specs=i,this.panels=o,this.top.sync(a),this.bottom.sync(s);for(var p=0,d=u;pthis.i;){var t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}]),e}(),So=function(){function e(t,n){var r=this;_(this,e),this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");var i=function(e){r.dom.addEventListener(e,(function(i){var o,a=i.target;if(a!=r.dom&&r.dom.contains(a)){for(;a.parentNode!=r.dom;)a=a.parentNode;var s=a.getBoundingClientRect();o=(s.top+s.bottom)/2}else o=i.clientY;var u=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[e](t,u,i)&&i.preventDefault()}))};for(var o in n.domEventHandlers)i(o);this.markers=wo(n.markers(t)),n.initialSpacer&&(this.spacer=new _o(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return E(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=wo(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}var i=e.view.viewport;return!r.k.eq(this.markers,t,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}},{key:"destroy",value:function(){var e,t=w(this.elements);try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}}}]),e}(),_o=function(){function e(t,n,r,i){_(this,e),this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}return E(e,[{key:"update",value:function(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return[To.of(e),bo(),Ao]}function $o(e){for(var t=9;ti&&(i=s,n.push(Qo.range(s)))}}catch(e){o.e(e)}finally{o.f()}return r.k.of(n)}));function Mo(){return Io}},110:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return u}));var r=n(10),i=(n(18),n(151)),o=Symbol();function a(e){return!!e.extensions&&Array.isArray(e.extensions[o])}function s(e){return e.hasOwnProperty("graphQLErrors")}var u=function(e){function t(n){var o,a,s=n.graphQLErrors,u=n.protocolErrors,c=n.clientErrors,l=n.networkError,f=n.errorMessage,h=n.extraInfo,p=e.call(this,f)||this;return p.name="ApolloError",p.graphQLErrors=s||[],p.protocolErrors=u||[],p.clientErrors=c||[],p.networkError=l||null,p.message=f||(o=p,a=Object(r.__spreadArray)(Object(r.__spreadArray)(Object(r.__spreadArray)([],o.graphQLErrors,!0),o.clientErrors,!0),o.protocolErrors,!0),o.networkError&&a.push(o.networkError),a.map((function(e){return Object(i.a)(e)&&e.message||"Error message not found."})).join("\n")),p.extraInfo=h,p.cause=Object(r.__spreadArray)(Object(r.__spreadArray)(Object(r.__spreadArray)([l],s||[],!0),u||[],!0),c||[],!0).find((function(e){return!!e}))||null,p.__proto__=t.prototype,p}return Object(r.__extends)(t,e),t}(Error)},1100:function(e,t,n){"use strict";var r=n(118),i=n(64);var o=n(138),a=n(0),s=n.n(a),u=n(587);function c(e,t){var n=Object.create(null);return e&&a.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(a.isValidElement)(e)?t(e):e}(e)})),n}function l(e,t,n){return null!=n[t]?n[t]:e.props[t]}function f(e,t,n){var r=c(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var u in t){if(i[u])for(r=0;r0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),"".concat(n.connection.key,"(").concat(p(i),")")}return n.connection.key}var o=e;if(t){var a=p(t);o+="(".concat(a,")")}return n&&Object.keys(n).forEach((function(e){-1===h.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(p(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=p;return p=e,t}});function m(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return l(n,r,i,t)})),n}return null}function v(e){return e.alias?e.alias.value:e.name.value}function g(e,t,n){for(var r,i=0,a=t.selections;i=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},137:function(e,t,n){"use strict";n.d(t,"a",(function(){return K})),n.d(t,"b",(function(){return G})),n.d(t,"c",(function(){return fe})),n.d(t,"d",(function(){return le})),n.d(t,"e",(function(){return Be})),n.d(t,"f",(function(){return E})),n.d(t,"g",(function(){return U})),n.d(t,"h",(function(){return Ue})),n.d(t,"i",(function(){return ze})),n.d(t,"j",(function(){return qe})),n.d(t,"k",(function(){return Ze})),n.d(t,"l",(function(){return Ne})),n.d(t,"m",(function(){return C})),n.d(t,"n",(function(){return j}));var r=n(7),i=n(11),o=n(9),a=n(27);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);no.from&&a.from==i.to&&(a=i.to==o.to+1?o:e.doc.lineAt(i.to-1));var s=n.length-1;s>=0&&n[s].to>o.from?n[s].to=a.to:n.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:a.to})}}catch(e){r.e(e)}finally{r.f()}return n}(t))}),0);function y(e,t){var n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function b(e,t,n,r){var i,o,a=t.open,s=t.close,u=e.sliceDoc(n-50,n),c=e.sliceDoc(r,r+50),l=/\s*$/.exec(u)[0].length,f=/^\s*/.exec(c)[0].length,h=u.length-l;if(u.slice(h-a.length,h)==a&&c.slice(f,f+s.length)==s)return{open:{pos:n-l,margin:l&&1},close:{pos:r+f,margin:f&&1}};r-n<=100?i=o=e.sliceDoc(n,r):(i=e.sliceDoc(n,n+50),o=e.sliceDoc(r-50,r));var p=/^\s*/.exec(i)[0].length,d=/\s*$/.exec(o)[0].length,m=o.length-d-s.length;return i.slice(p,p+a.length)==a&&o.slice(m,m+s.length)==s?{open:{pos:n+p+a.length,margin:/\s/.test(i.charAt(p+a.length))?1:0},close:{pos:r-d-s.length,margin:/\s/.test(o.charAt(m-1))?1:0}}:null}function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.selection.ranges,r=n.map((function(e){return y(t,e.from).block}));if(!r.every((function(e){return e})))return null;var i=n.map((function(e,n){return b(t,r[n],e.from,e.to)}));if(2!=e&&!i.every((function(e){return e})))return{changes:t.changes(n.map((function(e,t){return i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]})))};if(1!=e&&i.some((function(e){return e}))){for(var o,a=[],s=0;s2&&void 0!==arguments[2]?arguments[2]:t.selection.ranges,i=[],o=-1,a=h(r);try{for(a.s();!(n=a.n()).done;){var s=n.value,u=s.from,c=s.to,l=i.length,f=1e9,p=y(t,u).line;if(p){for(var d=u;d<=c;){var m=t.doc.lineAt(d);if(m.from>o&&(u==c||c>m.from)){o=m.from;var v=/^\s*/.exec(m.text)[0].length,g=v==m.length,b=m.text.slice(v,v+p.length)==p?v:-1;v=0}))){var A,R=[],$=h(i);try{for($.s();!(A=$.n()).done;){var Q=A.value,I=Q.line,M=Q.comment,D=Q.token;if(M>=0){var N=I.from+M,F=N+D.length;" "==I.text[F-I.from]&&F++,R.push({from:N,to:F})}}}catch(e){$.e(e)}finally{$.f()}return{changes:R}}return null}var x=r.a.define(),k=r.a.define(),S=r.h.define(),_=r.h.define({combine:function(e){return Object(r.t)(e,{minDepth:100,newGroupDelay:500,joinToEvent:function(e,t){return t}},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:function(e,t){return function(n,r){return e(n,r)||t(n,r)}}})}}),P=r.o.define({create:function(){return z.empty},update:function(e,t){var n=t.state.facet(_),i=t.annotation(x);if(i){var o=$.fromTransaction(t,i.selection),a=i.side,s=0==a?e.undone:e.done;return s=o?Q(s,s.length,n.minDepth,o):D(s,t.startState.selection),new z(0==a?i.rest:s,0==a?s:i.rest)}var u=t.annotation(k);if("full"!=u&&"before"!=u||(e=e.isolate()),!1===t.annotation(r.q.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);var c=$.fromTransaction(t),l=t.annotation(r.q.time),f=t.annotation(r.q.userEvent);return c?e=e.addChanges(c,l,f,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,f,n.newGroupDelay)),"full"!=u&&"after"!=u||(e=e.isolate()),e},toJSON:function(e){return{done:e.done.map((function(e){return e.toJSON()})),undone:e.undone.map((function(e){return e.toJSON()}))}},fromJSON:function(e){return new z(e.done.map($.fromJSON),e.undone.map($.fromJSON))}});function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[P,_.of(e),i.c.domEventHandlers({beforeinput:function(e,t){var n="historyUndo"==e.inputType?j:"historyRedo"==e.inputType?C:null;return!!n&&(e.preventDefault(),n(t))}})]}function T(e,t){return function(n){var r=n.state,i=n.dispatch;if(!t&&r.readOnly)return!1;var o=r.field(P,!1);if(!o)return!1;var a=o.pop(e,r,t);return!!a&&(i(a),!0)}}var j=T(0,!1),C=T(1,!1),A=T(0,!0),R=T(1,!0);var $=function(){function e(t,n,r,i,o){u(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return l(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}},{key:"toJSON",value:function(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((function(e){return e.toJSON()}))}}}],[{key:"fromJSON",value:function(t){return new e(t.changes&&r.c.fromJSON(t.changes),[],t.mapped&&r.b.fromJSON(t.mapped),t.startSelection&&r.f.fromJSON(t.startSelection),t.selectionsAfter.map(r.f.fromJSON))}},{key:"fromTransaction",value:function(t,n){var r,i=M,o=h(t.startState.facet(S));try{for(o.s();!(r=o.n()).done;){var a=(0,r.value)(t);a.length&&(i=i.concat(a))}}catch(e){o.e(e)}finally{o.f()}return!i.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,M)}},{key:"selection",value:function(t){return new e(void 0,M,void 0,void 0,t)}}]),e}();function Q(e,t,n,r){var i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function I(e,t){return e.length?t.length?e.concat(t):e:t}var M=[];function D(e,t){if(e.length){var n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Q(e,e.length-1,1e9,n.setSelAfter(r)))}return[$.selection([t])]}function N(e){var t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function F(e,t){if(!e.length)return e;for(var n=e.length,r=M;n;){var i=L(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=e.slice(0,n);return o[n-1]=i,o}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[$.selection(r)]:M}function L(e,t,n){var i=I(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):M,n);if(!e.changes)return $.selection(i);var o=e.changes.map(t),a=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(a):a;return new $(o,r.n.mapEffects(e.effects,t),s,e.startSelection.map(a),i)}var q=/^(input\.type|delete)($|\.)/,z=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;u(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return l(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,i,o,a){var s=this.done,u=s[s.length-1];return s=u&&u.changes&&!u.changes.empty&&t.changes&&(!i||q.test(i))&&(!u.selectionsAfter.length&&n-this.prevTime=s&&i<=u&&(r=!0)}})),r}(u.changes,t.changes))||"input.type.compose"==i)?Q(s,s.length-1,o.minDepth,new $(t.changes.compose(u.changes),I(r.n.mapEffects(t.effects,u.changes),u.effects),u.mapped,u.startSelection,M)):Q(s,s.length,o.minDepth,t),new e(s,M,n,i)}},{key:"addSelection",value:function(t,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:M;return s.length>0&&n-this.prevTime2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function te(e,t,n){for(var i=Object(o.I)(e).resolveInner(t.head),s=n?a.c.closedBy:a.c.openedBy,u=t.head;;){var c=n?i.childAfter(u):i.childBefore(u);if(!c)break;ee(e,c,s)?i=c:u=n?c.to:c.from}var l,f;return f=i.type.prop(s)&&(l=n?Object(o.F)(e,i.from,1):Object(o.F)(e,i.to,-1))&&l.matched?n?l.end.to:l.end.from:n?i.to:i.from,r.f.cursor(f,n?-1:1)}function ne(e,t){return V(e,(function(n){if(!n.empty)return W(n,t);var r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)}))}var re=function(e){return ne(e,!1)},ie=function(e){return ne(e,!0)};function oe(e){var t,n=e.scrollDOM.clientHeightc&&s.bottom0&&Object(o.F)(e,t.head-1,1)||t.heado&&(n="delete.forward",s=je(e,s,!0)),o=Math.min(o,s),a=Math.max(a,s)}else o=je(e,o,!1),a=je(e,a,!0);return o==a?{range:i}:{changes:{from:o,to:a},range:r.f.cursor(o,ot&&(t=n?r:e)}))}}catch(e){o.e(e)}finally{o.f()}}return t}var Ce=function(e,t,n){return Te(e,(function(i){var a,s,u=i.from,c=e.state,l=c.doc.lineAt(u);if(n&&!t&&u>l.from&&u=a.number){var u=n[n.length-1];u.to=s.to,u.ranges.push(o)}else n.push({from:a.from,to:s.to,ranges:[o]});r=s.number+1}}catch(e){i.e(e)}finally{i.f()}return n}function Me(e,t,n){if(e.readOnly)return!1;var i,o=[],a=[],s=h(Ie(e));try{for(s.s();!(i=s.n()).done;){var u=i.value;if(n?u.to!=e.doc.length:0!=u.from){var c=e.doc.lineAt(n?u.to+1:u.from-1),l=c.length+1;if(n){o.push({from:u.to,to:c.to},{from:u.from,insert:c.text+e.lineBreak});var f,p=h(u.ranges);try{for(p.s();!(f=p.n()).done;){var d=f.value;a.push(r.f.range(Math.min(e.doc.length,d.anchor+l),Math.min(e.doc.length,d.head+l)))}}catch(e){p.e(e)}finally{p.f()}}else{o.push({from:c.from,to:u.from},{from:u.to,insert:e.lineBreak+c.text});var m,v=h(u.ranges);try{for(v.s();!(m=v.n()).done;){var g=m.value;a.push(r.f.range(g.anchor-l,g.head-l))}}catch(e){v.e(e)}finally{v.f()}}}}}catch(e){s.e(e)}finally{s.f()}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:r.f.create(a,e.selection.mainIndex),userEvent:"move.line"})),!0)}function De(e,t,n){if(e.readOnly)return!1;var r,i=[],o=h(Ie(e));try{for(o.s();!(r=o.n()).done;){var a=r.value;n?i.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):i.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)})}}catch(e){o.e(e)}finally{o.f()}return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var Ne=Fe(!1);function Fe(e){return function(t){var n=t.state,i=t.dispatch;if(n.readOnly)return!1;var s=n.changeByRange((function(t){var i=t.from,s=t.to,u=n.doc.lineAt(i),c=!e&&i==s&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=Object(o.I)(e).resolveInner(t),i=r.childBefore(t),s=r.childAfter(t);return i&&s&&i.to<=t&&s.from>=t&&(n=i.type.prop(a.c.closedBy))&&n.indexOf(s.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}(n,i);e&&(i=s=(s<=u.to?u:n.doc.lineAt(s)).to);var l=new o.b(n,{simulateBreak:i,simulateDoubleBreak:!!c}),f=Object(o.z)(l,i);for(null==f&&(f=Object(r.u)(/^\s*/.exec(n.doc.lineAt(i).text)[0],n.tabSize));su.from&&in&&(i.empty||i.to>s.from)&&(t(s,o,i),n=s.number),a=s.to+1}var u=e.changes(o);return{changes:o,range:r.f.range(u.mapPos(i.anchor,1),u.mapPos(i.head,1))}}))}var qe=function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=Object.create(null),i=new o.b(t,{overrideIndentation:function(e){var t=r[e];return null==t?-1:t}}),a=Le(t,(function(e,n,a){var s=Object(o.z)(i,e.from);if(null!=s){/\S/.test(e.text)||(s=0);var u=/^\s*/.exec(e.text)[0],c=Object(o.C)(t,s);(u!=c||a.from1?o=r.f.create([i.main]):i.main.empty||(o=r.f.create([r.f.cursor(i.main.head)])),!!o&&(n(Z(t,o)),!0)}},{key:"Mod-Enter",run:Fe(!0)},{key:"Alt-l",mac:"Ctrl-l",run:function(e){var t=e.state,n=e.dispatch,i=Ie(t).map((function(e){var n=e.from,i=e.to;return r.f.range(n,Math.min(i+1,t.doc.length))}));return n(t.update({selection:r.f.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,i=B(t.selection,(function(e){var n=Object(o.I)(t),i=n.resolveStack(e.from,1);if(e.empty){var a=n.resolveStack(e.from,-1);a.node.from>=i.node.from&&a.node.to<=i.node.to&&(i=a)}for(var s=i;s;s=s.next){var u=s.node;if((u.from=e.to||u.to>e.to&&u.from<=e.from)&&s.next)return r.f.range(u.to,u.from)}return e}));return!i.eq(t.selection)&&(n(Z(t,i)),!0)},preventDefault:!0},{key:"Mod-[",run:Ue},{key:"Mod-]",run:ze},{key:"Mod-Alt-\\",run:qe},{key:"Shift-Mod-k",run:function(e){if(e.state.readOnly)return!1;var t=e.state,n=t.changes(Ie(t).map((function(e){var n=e.from,r=e.to;return n>0?n--:rn?n:Math.max(0,t.head-1)}))}},{mac:"Mod-Delete",run:function(e){return Te(e,(function(t){var n=e.moveToLineBoundary(t,!0).head;return t.head=0;h--){var p=a[h];"."===p?o(a,h):".."===p?(o(a,h),f++):f&&(o(a,h),f--)}if(!c)for(;f--;f)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var d=a.join("/");return n&&"/"!==d.substr(-1)&&(d+="/"),d};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},c=n(218);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function m(e,t,n,i){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function v(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,i):n.push(i),f({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=m(e,t,h(),O.location);l.confirmTransitionTo(i,r,n,(function(e){e&&(O.entries[O.index]=i,f({action:r,location:i}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=O.index+e;return t>=0&&t(t.getStackTop().scope=n,r(n)))):t.withScope(r)}return t.withScope(e[0])}function d(){return Object(o.a)().getClient()}function m(){return Object(o.a)().getScope()}function v(e){const t=d(),n=Object(o.b)(),s=m(),{release:u,environment:c=i.a}=t&&t.getOptions()||{},{userAgent:l}=r.a.navigator||{},f=Object(a.b)({release:u,environment:c,user:s.getUser()||n.getUser(),...l&&{userAgent:l},...e}),h=n.getSession();return h&&"ok"===h.status&&Object(a.c)(h,{status:"exited"}),g(),n.setSession(f),s.setSession(f),f}function g(){const e=Object(o.b)(),t=m(),n=t.getSession()||e.getSession();n&&Object(a.a)(n),y(),e.setSession(),t.setSession()}function y(){const e=Object(o.b)(),t=m(),n=d(),r=t.getSession()||e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function b(e=!1){e?g():y()}},156:function(e,t,n){"use strict";n.r(t),n.d(t,"css",(function(){return M})),n.d(t,"cssCompletionSource",(function(){return Q})),n.d(t,"cssLanguage",(function(){return I})),n.d(t,"defineCSSCompletionSource",(function(){return $}));var r=n(101),i=n(5),o=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function a(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function s(e){return e>=48&&e<=57}var u=new r.b((function(e,t){for(var n=!1,r=0,i=0;;i++){var o=e.next;if(a(o)||45==o||95==o||n&&s(o))!n&&(45!=o||i>0)&&(n=!0),r===i&&45==o&&r++,e.advance();else{if(92!=o||10==e.peek(1)){n&&e.acceptToken(40==o?100:2==r&&t.canShift(2)?2:101);break}e.advance(),e.next>-1&&e.advance(),n=!0}}})),c=new r.b((function(e){if(o.includes(e.peek(-1))){var t=e.next;(a(t)||95==t||35==t||46==t||91==t||58==t&&a(e.peek(1))||45==t||38==t)&&e.acceptToken(99)}})),l=new r.b((function(e){if(!o.includes(e.peek(-1))){var t=e.next;if(37==t&&(e.advance(),e.acceptToken(1)),a(t)){do{e.advance()}while(a(e.next)||s(e.next));e.acceptToken(1)}}})),f=Object(i.c)({"AtKeyword import charset namespace keyframes media supports":i.e.definitionKeyword,"from to selector":i.e.keyword,NamespaceName:i.e.namespace,KeyframeName:i.e.labelName,KeyframeRangeName:i.e.operatorKeyword,TagName:i.e.tagName,ClassName:i.e.className,PseudoClassName:i.e.constant(i.e.className),IdName:i.e.labelName,"FeatureName PropertyName":i.e.propertyName,AttributeName:i.e.attributeName,NumberLiteral:i.e.number,KeywordQuery:i.e.keyword,UnaryQueryOp:i.e.operatorKeyword,"CallTag ValueName":i.e.atom,VariableName:i.e.variableName,Callee:i.e.operatorKeyword,Unit:i.e.unit,"UniversalSelector NestingSelector":i.e.definitionOperator,MatchOp:i.e.compareOperator,"ChildOp SiblingOp, LogicOp":i.e.logicOperator,BinOp:i.e.arithmeticOperator,Important:i.e.modifier,Comment:i.e.blockComment,ColorLiteral:i.e.color,"ParenthesizedContent StringLiteral":i.e.string,":":i.e.punctuation,"PseudoOp #":i.e.derefOperator,"; ,":i.e.separator,"( )":i.e.paren,"[ ]":i.e.squareBracket,"{ }":i.e.brace}),h={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},p={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},d={__proto__:null,not:132,only:132},m=r.c.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[c,l,u,1,2,3,4,new r.d("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:function(e){return h[e]||-1}},{term:58,get:function(e){return p[e]||-1}},{term:101,get:function(e){return d[e]||-1}}],tokenPrec:1219}),v=n(9),g=n(27);function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n4096){var r=j.get(t);if(r)return r;var i=[],o=new Set,a=t.cursor(g.b.IncludeAnonymous);if(a.firstChild())do{var s,u=y(R(e,a.node,n));try{for(u.s();!(s=u.n()).done;){var c=s.value;o.has(c.label)||(o.add(c.label),i.push(c))}}catch(e){u.e(e)}finally{u.f()}}while(a.nextSibling());return j.set(t,i),i}var l=[],f=new Set;return t.cursor().iterate((function(t){var r;if(n(t)&&t.matchContext(C)&&":"==(null===(r=t.node.nextSibling)||void 0===r?void 0:r.name)){var i=e.sliceString(t.from,t.to);f.has(i)||(f.add(i),l.push({label:i,type:"variable"}))}})),l}var $=function(e){return function(t){var n=t.state,r=t.pos,i=Object(v.I)(n).resolveInner(r,-1),o=i.type.isError&&i.from==i.to-1&&"-"==n.doc.sliceString(i.from,i.to);if("PropertyName"==i.name||(o||"TagName"==i.name)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:x(),validFor:E};if("ValueName"==i.name)return{from:i.from,options:S,validFor:E};if("PseudoClassName"==i.name)return{from:i.from,options:k,validFor:E};if(e(i)||(t.explicit||o)&&function(e,t){var n;if(("("==e.name||e.type.isError)&&(e=e.parent||e),"ArgList"!=e.name)return!1;var r=null===(n=e.parent)||void 0===n?void 0:n.firstChild;return"Callee"==(null==r?void 0:r.name)&&"var"==t.sliceString(r.from,r.to)}(i,n.doc))return{from:e(i)||o?i.from:r,options:R(n.doc,A(i),e),validFor:T};if("TagName"==i.name){for(var a=i.parent;a;a=a.parent)if("Block"==a.name)return{from:i.from,options:x(),validFor:E};return{from:i.from,options:_,validFor:E}}if("AtKeyword"==i.name)return{from:i.from,options:P,validFor:E};if(!t.explicit)return null;var s=i.resolve(r),u=s.childBefore(r);return u&&":"==u.name&&"PseudoClassSelector"==s.name?{from:r,options:k,validFor:E}:u&&":"==u.name&&"Declaration"==s.name||"ArgList"==s.name?{from:r,options:S,validFor:E}:"Block"==s.name||"Styles"==s.name?{from:r,options:x(),validFor:E}:null}},Q=$((function(e){return"VariableName"==e.name})),I=v.c.define({name:"css",parser:m.configure({props:[v.A.add({Declaration:Object(v.m)()}),v.w.add({"Block KeyframeList":v.u})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function M(){return new v.f(I,I.data.of({autocomplete:Q}))}},160:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(9);function i(e){return new r.f(r.h.define(e))}function o(e){return n.e(67).then(n.bind(null,987)).then((function(t){return t.sql({dialect:t[e]})}))}var a=[r.e.of({name:"C",extensions:["c","h","ino"],load:function(){return n.e(12).then(n.bind(null,924)).then((function(e){return e.cpp()}))}}),r.e.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:function(){return n.e(12).then(n.bind(null,924)).then((function(e){return e.cpp()}))}}),r.e.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:function(){return o("Cassandra")}}),r.e.of({name:"CSS",extensions:["css"],load:function(){return Promise.resolve().then(n.bind(null,156)).then((function(e){return e.css()}))}}),r.e.of({name:"Go",extensions:["go"],load:function(){return n.e(58).then(n.bind(null,1078)).then((function(e){return e.go()}))}}),r.e.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:function(){return Promise.resolve().then(n.bind(null,205)).then((function(e){return e.html()}))}}),r.e.of({name:"Java",extensions:["java"],load:function(){return n.e(59).then(n.bind(null,1079)).then((function(e){return e.java()}))}}),r.e.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:function(){return Promise.resolve().then(n.bind(null,185)).then((function(e){return e.javascript()}))}}),r.e.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:function(){return n.e(60).then(n.bind(null,1080)).then((function(e){return e.json()}))}}),r.e.of({name:"JSX",extensions:["jsx"],load:function(){return Promise.resolve().then(n.bind(null,185)).then((function(e){return e.javascript({jsx:!0})}))}}),r.e.of({name:"LESS",extensions:["less"],load:function(){return n.e(61).then(n.bind(null,988)).then((function(e){return e.less()}))}}),r.e.of({name:"Liquid",extensions:["liquid"],load:function(){return n.e(62).then(n.bind(null,989)).then((function(e){return e.liquid()}))}}),r.e.of({name:"MariaDB SQL",load:function(){return o("MariaSQL")}}),r.e.of({name:"Markdown",extensions:["md","markdown","mkd"],load:function(){return n.e(63).then(n.bind(null,1081)).then((function(e){return e.markdown()}))}}),r.e.of({name:"MS SQL",load:function(){return o("MSSQL")}}),r.e.of({name:"MySQL",load:function(){return o("MySQL")}}),r.e.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:function(){return n.e(64).then(n.bind(null,1082)).then((function(e){return e.php()}))}}),r.e.of({name:"PLSQL",extensions:["pls"],load:function(){return o("PLSQL")}}),r.e.of({name:"PostgreSQL",load:function(){return o("PostgreSQL")}}),r.e.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:function(){return n.e(65).then(n.bind(null,1083)).then((function(e){return e.python()}))}}),r.e.of({name:"Rust",extensions:["rs"],load:function(){return n.e(66).then(n.bind(null,1084)).then((function(e){return e.rust()}))}}),r.e.of({name:"Sass",extensions:["sass"],load:function(){return n.e(13).then(n.bind(null,925)).then((function(e){return e.sass({indented:!0})}))}}),r.e.of({name:"SCSS",extensions:["scss"],load:function(){return n.e(13).then(n.bind(null,925)).then((function(e){return e.sass()}))}}),r.e.of({name:"SQL",extensions:["sql"],load:function(){return o("StandardSQL")}}),r.e.of({name:"SQLite",load:function(){return o("SQLite")}}),r.e.of({name:"TSX",extensions:["tsx"],load:function(){return Promise.resolve().then(n.bind(null,185)).then((function(e){return e.javascript({jsx:!0,typescript:!0})}))}}),r.e.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:function(){return Promise.resolve().then(n.bind(null,185)).then((function(e){return e.javascript({typescript:!0})}))}}),r.e.of({name:"WebAssembly",extensions:["wat","wast"],load:function(){return n.e(68).then(n.bind(null,990)).then((function(e){return e.wast()}))}}),r.e.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:function(){return n.e(69).then(n.bind(null,1085)).then((function(e){return e.xml()}))}}),r.e.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:function(){return n.e(70).then(n.bind(null,1086)).then((function(e){return e.yaml()}))}}),r.e.of({name:"APL",extensions:["dyalog","apl"],load:function(){return n.e(71).then(n.bind(null,991)).then((function(e){return i(e.apl)}))}}),r.e.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:function(){return n.e(72).then(n.bind(null,992)).then((function(e){return i(e.asciiArmor)}))}}),r.e.of({name:"ASN.1",extensions:["asn","asn1"],load:function(){return n.e(73).then(n.bind(null,993)).then((function(e){return i(e.asn1({}))}))}}),r.e.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:function(){return n.e(74).then(n.bind(null,994)).then((function(e){return i(e.asterisk)}))}}),r.e.of({name:"Brainfuck",extensions:["b","bf"],load:function(){return n.e(75).then(n.bind(null,995)).then((function(e){return i(e.brainfuck)}))}}),r.e.of({name:"Cobol",extensions:["cob","cpy"],load:function(){return n.e(77).then(n.bind(null,996)).then((function(e){return i(e.cobol)}))}}),r.e.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:function(){return n.e(0).then(n.bind(null,572)).then((function(e){return i(e.csharp)}))}}),r.e.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:function(){return n.e(4).then(n.bind(null,865)).then((function(e){return i(e.clojure)}))}}),r.e.of({name:"ClojureScript",extensions:["cljs"],load:function(){return n.e(4).then(n.bind(null,865)).then((function(e){return i(e.clojure)}))}}),r.e.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:function(){return n.e(81).then(n.bind(null,997)).then((function(e){return i(e.gss)}))}}),r.e.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:function(){return n.e(76).then(n.bind(null,998)).then((function(e){return i(e.cmake)}))}}),r.e.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:function(){return n.e(78).then(n.bind(null,999)).then((function(e){return i(e.coffeeScript)}))}}),r.e.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:function(){return n.e(79).then(n.bind(null,1e3)).then((function(e){return i(e.commonLisp)}))}}),r.e.of({name:"Cypher",extensions:["cyp","cypher"],load:function(){return n.e(82).then(n.bind(null,1001)).then((function(e){return i(e.cypher)}))}}),r.e.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:function(){return n.e(122).then(n.bind(null,1002)).then((function(e){return i(e.cython)}))}}),r.e.of({name:"Crystal",extensions:["cr"],load:function(){return n.e(80).then(n.bind(null,1003)).then((function(e){return i(e.crystal)}))}}),r.e.of({name:"D",extensions:["d"],load:function(){return n.e(83).then(n.bind(null,1004)).then((function(e){return i(e.d)}))}}),r.e.of({name:"Dart",extensions:["dart"],load:function(){return n.e(0).then(n.bind(null,572)).then((function(e){return i(e.dart)}))}}),r.e.of({name:"diff",extensions:["diff","patch"],load:function(){return n.e(84).then(n.bind(null,1005)).then((function(e){return i(e.diff)}))}}),r.e.of({name:"Dockerfile",filename:/^Dockerfile$/,load:function(){return n.e(52).then(n.bind(null,1006)).then((function(e){return i(e.dockerFile)}))}}),r.e.of({name:"DTD",extensions:["dtd"],load:function(){return n.e(85).then(n.bind(null,1007)).then((function(e){return i(e.dtd)}))}}),r.e.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:function(){return n.e(86).then(n.bind(null,1008)).then((function(e){return i(e.dylan)}))}}),r.e.of({name:"EBNF",load:function(){return n.e(87).then(n.bind(null,1009)).then((function(e){return i(e.ebnf)}))}}),r.e.of({name:"ECL",extensions:["ecl"],load:function(){return n.e(88).then(n.bind(null,1010)).then((function(e){return i(e.ecl)}))}}),r.e.of({name:"edn",extensions:["edn"],load:function(){return n.e(4).then(n.bind(null,865)).then((function(e){return i(e.clojure)}))}}),r.e.of({name:"Eiffel",extensions:["e"],load:function(){return n.e(89).then(n.bind(null,1011)).then((function(e){return i(e.eiffel)}))}}),r.e.of({name:"Elm",extensions:["elm"],load:function(){return n.e(90).then(n.bind(null,1012)).then((function(e){return i(e.elm)}))}}),r.e.of({name:"Erlang",extensions:["erl"],load:function(){return n.e(91).then(n.bind(null,1013)).then((function(e){return i(e.erlang)}))}}),r.e.of({name:"Esper",load:function(){return n.e(134).then(n.bind(null,1014)).then((function(e){return i(e.esper)}))}}),r.e.of({name:"Factor",extensions:["factor"],load:function(){return n.e(53).then(n.bind(null,1015)).then((function(e){return i(e.factor)}))}}),r.e.of({name:"FCL",load:function(){return n.e(92).then(n.bind(null,1016)).then((function(e){return i(e.fcl)}))}}),r.e.of({name:"Forth",extensions:["forth","fth","4th"],load:function(){return n.e(93).then(n.bind(null,1017)).then((function(e){return i(e.forth)}))}}),r.e.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:function(){return n.e(94).then(n.bind(null,1018)).then((function(e){return i(e.fortran)}))}}),r.e.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:function(){return n.e(5).then(n.bind(null,866)).then((function(e){return i(e.fSharp)}))}}),r.e.of({name:"Gas",extensions:["s"],load:function(){return n.e(95).then(n.bind(null,1019)).then((function(e){return i(e.gas)}))}}),r.e.of({name:"Gherkin",extensions:["feature"],load:function(){return n.e(96).then(n.bind(null,1020)).then((function(e){return i(e.gherkin)}))}}),r.e.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:function(){return n.e(97).then(n.bind(null,1021)).then((function(e){return i(e.groovy)}))}}),r.e.of({name:"Haskell",extensions:["hs"],load:function(){return n.e(98).then(n.bind(null,1022)).then((function(e){return i(e.haskell)}))}}),r.e.of({name:"Haxe",extensions:["hx"],load:function(){return n.e(15).then(n.bind(null,919)).then((function(e){return i(e.haxe)}))}}),r.e.of({name:"HXML",extensions:["hxml"],load:function(){return n.e(15).then(n.bind(null,919)).then((function(e){return i(e.hxml)}))}}),r.e.of({name:"HTTP",load:function(){return n.e(99).then(n.bind(null,1023)).then((function(e){return i(e.http)}))}}),r.e.of({name:"IDL",extensions:["pro"],load:function(){return n.e(100).then(n.bind(null,1024)).then((function(e){return i(e.idl)}))}}),r.e.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:function(){return n.e(16).then(n.bind(null,985)).then((function(e){return i(e.jsonld)}))}}),r.e.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load:function(){return n.e(101).then(n.bind(null,1025)).then((function(e){return i(e.jinja2)}))}}),r.e.of({name:"Julia",extensions:["jl"],load:function(){return n.e(102).then(n.bind(null,1026)).then((function(e){return i(e.julia)}))}}),r.e.of({name:"Kotlin",extensions:["kt","kts"],load:function(){return n.e(0).then(n.bind(null,572)).then((function(e){return i(e.kotlin)}))}}),r.e.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:function(){return n.e(103).then(n.bind(null,1027)).then((function(e){return i(e.liveScript)}))}}),r.e.of({name:"Lua",extensions:["lua"],load:function(){return n.e(104).then(n.bind(null,1028)).then((function(e){return i(e.lua)}))}}),r.e.of({name:"mIRC",extensions:["mrc"],load:function(){return n.e(107).then(n.bind(null,1029)).then((function(e){return i(e.mirc)}))}}),r.e.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:function(){return n.e(105).then(n.bind(null,1030)).then((function(e){return i(e.mathematica)}))}}),r.e.of({name:"Modelica",extensions:["mo"],load:function(){return n.e(108).then(n.bind(null,1031)).then((function(e){return i(e.modelica)}))}}),r.e.of({name:"MUMPS",extensions:["mps"],load:function(){return n.e(109).then(n.bind(null,1032)).then((function(e){return i(e.mumps)}))}}),r.e.of({name:"Mbox",extensions:["mbox"],load:function(){return n.e(106).then(n.bind(null,1033)).then((function(e){return i(e.mbox)}))}}),r.e.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:function(){return n.e(110).then(n.bind(null,1034)).then((function(e){return i(e.nginx)}))}}),r.e.of({name:"NSIS",extensions:["nsh","nsi"],load:function(){return n.e(54).then(n.bind(null,1035)).then((function(e){return i(e.nsis)}))}}),r.e.of({name:"NTriples",extensions:["nt","nq"],load:function(){return n.e(111).then(n.bind(null,1036)).then((function(e){return i(e.ntriples)}))}}),r.e.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:function(){return n.e(0).then(n.bind(null,572)).then((function(e){return i(e.objectiveC)}))}}),r.e.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:function(){return n.e(0).then(n.bind(null,572)).then((function(e){return i(e.objectiveCpp)}))}}),r.e.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:function(){return n.e(5).then(n.bind(null,866)).then((function(e){return i(e.oCaml)}))}}),r.e.of({name:"Octave",extensions:["m"],load:function(){return n.e(112).then(n.bind(null,1037)).then((function(e){return i(e.octave)}))}}),r.e.of({name:"Oz",extensions:["oz"],load:function(){return n.e(113).then(n.bind(null,1038)).then((function(e){return i(e.oz)}))}}),r.e.of({name:"Pascal",extensions:["p","pas"],load:function(){return n.e(114).then(n.bind(null,1039)).then((function(e){return i(e.pascal)}))}}),r.e.of({name:"Perl",extensions:["pl","pm"],load:function(){return n.e(115).then(n.bind(null,1040)).then((function(e){return i(e.perl)}))}}),r.e.of({name:"Pig",extensions:["pig"],load:function(){return n.e(116).then(n.bind(null,1041)).then((function(e){return i(e.pig)}))}}),r.e.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:function(){return n.e(117).then(n.bind(null,1042)).then((function(e){return i(e.powerShell)}))}}),r.e.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:function(){return n.e(118).then(n.bind(null,1043)).then((function(e){return i(e.properties)}))}}),r.e.of({name:"ProtoBuf",extensions:["proto"],load:function(){return n.e(119).then(n.bind(null,1044)).then((function(e){return i(e.protobuf)}))}}),r.e.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:function(){return Promise.all([n.e(16),n.e(120)]).then(n.bind(null,1045)).then((function(e){return i(e.pug)}))}}),r.e.of({name:"Puppet",extensions:["pp"],load:function(){return n.e(121).then(n.bind(null,1046)).then((function(e){return i(e.puppet)}))}}),r.e.of({name:"Q",extensions:["q"],load:function(){return n.e(123).then(n.bind(null,1047)).then((function(e){return i(e.q)}))}}),r.e.of({name:"R",alias:["rscript"],extensions:["r","R"],load:function(){return n.e(124).then(n.bind(null,1048)).then((function(e){return i(e.r)}))}}),r.e.of({name:"RPM Changes",load:function(){return n.e(17).then(n.bind(null,920)).then((function(e){return i(e.rpmChanges)}))}}),r.e.of({name:"RPM Spec",extensions:["spec"],load:function(){return n.e(17).then(n.bind(null,920)).then((function(e){return i(e.rpmSpec)}))}}),r.e.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:function(){return n.e(125).then(n.bind(null,1049)).then((function(e){return i(e.ruby)}))}}),r.e.of({name:"SAS",extensions:["sas"],load:function(){return n.e(126).then(n.bind(null,1050)).then((function(e){return i(e.sas)}))}}),r.e.of({name:"Scala",extensions:["scala"],load:function(){return n.e(0).then(n.bind(null,572)).then((function(e){return i(e.scala)}))}}),r.e.of({name:"Scheme",extensions:["scm","ss"],load:function(){return n.e(127).then(n.bind(null,1051)).then((function(e){return i(e.scheme)}))}}),r.e.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:function(){return n.e(128).then(n.bind(null,1052)).then((function(e){return i(e.shell)}))}}),r.e.of({name:"Sieve",extensions:["siv","sieve"],load:function(){return n.e(129).then(n.bind(null,1053)).then((function(e){return i(e.sieve)}))}}),r.e.of({name:"Smalltalk",extensions:["st"],load:function(){return n.e(130).then(n.bind(null,1054)).then((function(e){return i(e.smalltalk)}))}}),r.e.of({name:"Solr",load:function(){return n.e(131).then(n.bind(null,1055)).then((function(e){return i(e.solr)}))}}),r.e.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:function(){return n.e(5).then(n.bind(null,866)).then((function(e){return i(e.sml)}))}}),r.e.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:function(){return n.e(132).then(n.bind(null,1056)).then((function(e){return i(e.sparql)}))}}),r.e.of({name:"Spreadsheet",alias:["excel","formula"],load:function(){return n.e(133).then(n.bind(null,1057)).then((function(e){return i(e.spreadsheet)}))}}),r.e.of({name:"Squirrel",extensions:["nut"],load:function(){return n.e(0).then(n.bind(null,572)).then((function(e){return i(e.squirrel)}))}}),r.e.of({name:"Stylus",extensions:["styl"],load:function(){return n.e(135).then(n.bind(null,1058)).then((function(e){return i(e.stylus)}))}}),r.e.of({name:"Swift",extensions:["swift"],load:function(){return n.e(136).then(n.bind(null,1059)).then((function(e){return i(e.swift)}))}}),r.e.of({name:"sTeX",load:function(){return n.e(18).then(n.bind(null,921)).then((function(e){return i(e.stex)}))}}),r.e.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:function(){return n.e(18).then(n.bind(null,921)).then((function(e){return i(e.stex)}))}}),r.e.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:function(){return n.e(19).then(n.bind(null,922)).then((function(e){return i(e.verilog)}))}}),r.e.of({name:"Tcl",extensions:["tcl"],load:function(){return n.e(137).then(n.bind(null,1060)).then((function(e){return i(e.tcl)}))}}),r.e.of({name:"Textile",extensions:["textile"],load:function(){return n.e(138).then(n.bind(null,1061)).then((function(e){return i(e.textile)}))}}),r.e.of({name:"TiddlyWiki",load:function(){return n.e(139).then(n.bind(null,1062)).then((function(e){return i(e.tiddlyWiki)}))}}),r.e.of({name:"Tiki wiki",load:function(){return n.e(140).then(n.bind(null,1063)).then((function(e){return i(e.tiki)}))}}),r.e.of({name:"TOML",extensions:["toml"],load:function(){return n.e(141).then(n.bind(null,1064)).then((function(e){return i(e.toml)}))}}),r.e.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:function(){return n.e(142).then(n.bind(null,1065)).then((function(e){return i(e.troff)}))}}),r.e.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:function(){return n.e(144).then(n.bind(null,1066)).then((function(e){return i(e.ttcn)}))}}),r.e.of({name:"TTCN_CFG",extensions:["cfg"],load:function(){return n.e(143).then(n.bind(null,1067)).then((function(e){return i(e.ttcnCfg)}))}}),r.e.of({name:"Turtle",extensions:["ttl"],load:function(){return n.e(145).then(n.bind(null,1068)).then((function(e){return i(e.turtle)}))}}),r.e.of({name:"Web IDL",extensions:["webidl"],load:function(){return n.e(150).then(n.bind(null,1069)).then((function(e){return i(e.webIDL)}))}}),r.e.of({name:"VB.NET",extensions:["vb"],load:function(){return n.e(146).then(n.bind(null,1070)).then((function(e){return i(e.vb)}))}}),r.e.of({name:"VBScript",extensions:["vbs"],load:function(){return n.e(147).then(n.bind(null,1071)).then((function(e){return i(e.vbScript)}))}}),r.e.of({name:"Velocity",extensions:["vtl"],load:function(){return n.e(148).then(n.bind(null,1072)).then((function(e){return i(e.velocity)}))}}),r.e.of({name:"Verilog",extensions:["v"],load:function(){return n.e(19).then(n.bind(null,922)).then((function(e){return i(e.verilog)}))}}),r.e.of({name:"VHDL",extensions:["vhd","vhdl"],load:function(){return n.e(149).then(n.bind(null,1073)).then((function(e){return i(e.vhdl)}))}}),r.e.of({name:"XQuery",extensions:["xy","xquery"],load:function(){return n.e(151).then(n.bind(null,1074)).then((function(e){return i(e.xQuery)}))}}),r.e.of({name:"Yacas",extensions:["ys"],load:function(){return n.e(152).then(n.bind(null,1075)).then((function(e){return i(e.yacas)}))}}),r.e.of({name:"Z80",extensions:["z80"],load:function(){return n.e(153).then(n.bind(null,1076)).then((function(e){return i(e.z80)}))}}),r.e.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:function(){return n.e(6).then(n.bind(null,867)).then((function(e){return i(e.mscgen)}))}}),r.e.of({name:"Xù",extensions:["xu"],load:function(){return n.e(6).then(n.bind(null,867)).then((function(e){return i(e.xu)}))}}),r.e.of({name:"MsGenny",extensions:["msgenny"],load:function(){return n.e(6).then(n.bind(null,867)).then((function(e){return i(e.msgenny)}))}}),r.e.of({name:"Vue",extensions:["vue"],load:function(){return n.e(14).then(n.bind(null,868)).then((function(e){return e.vue()}))}}),r.e.of({name:"Angular Template",load:function(){return n.e(57).then(n.bind(null,1077)).then((function(e){return e.angular()}))}})]},161:function(e,t,n){"use strict";n.d(t,"e",(function(){return w})),n.d(t,"f",(function(){return k})),n.d(t,"a",(function(){return S})),n.d(t,"c",(function(){return _})),n.d(t,"b",(function(){return T})),n.d(t,"d",(function(){return j}));var r=n(10),i=n(18),o=n(54),a=n(790),s=n(42),u=n(837),c=n(842),l=n(110),f=n(60),h=n(583),p=n(770),d=n(616),m=n(354),v=n(871),g=Symbol.for("apollo.hook.wrappers");var y=Object.prototype.hasOwnProperty;function b(){}var O=Symbol();function w(e,t){return void 0===t&&(t=Object.create(null)),(n="useQuery",r=x,i=Object(p.a)(t&&t.client),o=i.queryManager,a=o&&o[g],(s=a&&a[n])?s(r):r)(e,t);var n,r,i,o,a,s}function x(e,t){var n=k(e,t),i=n.result,a=n.obsQueryFields;return o.useMemo((function(){return Object(r.__assign)(Object(r.__assign)({},i),a)}),[i,a])}function k(e,t){var n=Object(p.a)(t.client),i=o.useContext(Object(c.a)()).renderPromises,u=!!i,l=n.disableNetworkFetches,d=!1!==t.ssr&&!t.skip,m=t.partialRefetch,v=S(n,e,t,u),g=function(e,t,n,i,a){function s(r){var o;return Object(h.b)(t,h.a.Query),{client:e,query:t,observable:i&&i.getSSRObservable(a())||e.watchQuery(_(void 0,e,n,a())),resultData:{previousData:null===(o=null==r?void 0:r.resultData.current)||void 0===o?void 0:o.data}}}var u=o.useState(s),c=u[0],l=u[1];function f(e){var t,n;Object.assign(c.observable,((t={})[O]=e,t));var i=c.resultData;l(Object(r.__assign)(Object(r.__assign)({},c),{query:e.query,resultData:Object.assign(i,{previousData:(null===(n=i.current)||void 0===n?void 0:n.data)||i.previousData,current:void 0})}))}if(e!==c.client||t!==c.query){var p=s(c);return l(p),[p,f]}return[c,f]}(n,e,t,i,v),w=g[0],x=w.observable,k=w.resultData,T=g[1],R=v(x);!function(e,t,n,r,i){var o;t[O]&&!Object(s.b)(t[O],i)&&(t.reobserve(_(t,n,r,i)),e.previousData=(null===(o=e.current)||void 0===o?void 0:o.data)||e.previousData,e.current=void 0);t[O]=i}(k,x,n,t,R);var $=o.useMemo((function(){return function(e){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}(x)}),[x]);!function(e,t,n){t&&n&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}(x,i,d);var Q=function(e,t,n,r,i,u,c,l,h){var p=o.useRef(h);o.useEffect((function(){p.current=h}));var d=!l&&!u||!1!==r.ssr||r.skip?r.skip||"standby"===i.fetchPolicy?A:void 0:C,m=e.previousData,v=o.useMemo((function(){return d&&j(d,m,t,n)}),[n,t,d,m]);return Object(a.a)(o.useCallback((function(r){if(l)return function(){};var i=function(){var i=e.current,o=t.getCurrentResult();i&&i.loading===o.loading&&i.networkStatus===o.networkStatus&&Object(s.b)(i.data,o.data)||P(o,e,t,n,c,r,p.current)},o=function(u){if(a.current.unsubscribe(),a.current=t.resubscribeAfterError(i,o),!y.call(u,"graphQLErrors"))throw u;var l=e.current;(!l||l&&l.loading||!Object(s.b)(u,l.error))&&P({data:l&&l.data,error:u,loading:!1,networkStatus:f.a.error},e,t,n,c,r,p.current)},a={current:t.subscribe(i,o)};return function(){setTimeout((function(){return a.current.unsubscribe()}))}}),[u,l,t,e,c,n]),(function(){return v||E(e,t,p.current,c,n)}),(function(){return v||E(e,t,p.current,c,n)}))}(k,x,n,t,R,l,m,u,{onCompleted:t.onCompleted||b,onError:t.onError||b});return{result:Q,obsQueryFields:$,observable:x,resultData:k,client:n,onQueryExecuted:T}}function S(e,t,n,i){void 0===n&&(n={});var o=n.skip,a=(n.ssr,n.onCompleted,n.onError,n.defaultOptions),s=Object(r.__rest)(n,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(n){var r=Object.assign(s,{query:t});return!i||"network-only"!==r.fetchPolicy&&"cache-and-network"!==r.fetchPolicy||(r.fetchPolicy="cache-first"),r.variables||(r.variables={}),o?(r.initialFetchPolicy=r.initialFetchPolicy||r.fetchPolicy||T(a,e.defaultOptions),r.fetchPolicy="standby"):r.fetchPolicy||(r.fetchPolicy=(null==n?void 0:n.options.initialFetchPolicy)||T(a,e.defaultOptions)),r}}function _(e,t,n,r){var i=[],o=t.defaultOptions.watchQuery;return o&&i.push(o),n.defaultOptions&&i.push(n.defaultOptions),i.push(Object(d.a)(e&&e.options,r)),i.reduce(u.a)}function P(e,t,n,o,a,s,u){var c=t.current;c&&c.data&&(t.previousData=c.data),!e.error&&Object(m.b)(e.errors)&&(e.error=new l.a({graphQLErrors:e.errors})),t.current=j(function(e,t,n){if(e.partial&&n&&!e.loading&&(!e.data||0===Object.keys(e.data).length)&&"cache-only"!==t.options.fetchPolicy)return t.refetch(),Object(r.__assign)(Object(r.__assign)({},e),{loading:!0,networkStatus:f.a.refetch});return e}(e,n,a),t.previousData,n,o),s(),function(e,t,n){if(!e.loading){var r=function(e){return Object(m.b)(e.errors)?new l.a({graphQLErrors:e.errors}):e.error}(e);Promise.resolve().then((function(){r?n.onError(r):e.data&&t!==e.networkStatus&&e.networkStatus===f.a.ready&&n.onCompleted(e.data)})).catch((function(e){!1!==globalThis.__DEV__&&i.c.warn(e)}))}}(e,null==c?void 0:c.networkStatus,u)}function E(e,t,n,r,i){return e.current||P(t.getCurrentResult(),e,t,i,r,(function(){}),n),e.current}function T(e,t){var n;return(null==e?void 0:e.fetchPolicy)||(null===(n=null==t?void 0:t.watchQuery)||void 0===n?void 0:n.fetchPolicy)||"cache-first"}function j(e,t,n,i){var o=e.data,a=(e.partial,Object(r.__rest)(e,["data","partial"]));return Object(r.__assign)(Object(r.__assign)({data:o},a),{client:i,observable:n,variables:n.variables,called:e!==C&&e!==A,previousData:t})}var C=Object(v.a)({loading:!0,data:void 0,error:void 0,networkStatus:f.a.loading}),A=Object(v.a)({loading:!1,data:void 0,error:void 0,networkStatus:f.a.ready})},166:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(18),i=n(571),o=n(10);var a=n(86);function s(e,t){return t?t(e):i.a.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return i.a.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var o,a=u(n),l=u(r||new e(s));return o=c(a)&&c(l)?new e((function(e){return t(e)?a.request(e)||i.a.of():l.request(e)||i.a.of()})):new e((function(e,n){return t(e)?a.request(e,n)||i.a.of():l.request(e,n)||i.a.of()})),Object.assign(o,{left:a,right:l})},e.execute=function(e,t){return e.request(function(e,t){var n=Object(o.__assign)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n="function"==typeof e?Object(o.__assign)(Object(o.__assign)({},n),e(n)):Object(o.__assign)(Object(o.__assign)({},n),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Object(o.__assign)({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Object(a.g)(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,i=Object.keys(e);n>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?P(e)+t:t}function T(){return!0}function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function C(e,t){return R(e,t,0)}function A(e,t){return R(e,t,t)}function R(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var $=0,Q=1,I=2,M="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",N=M||D;function F(e){this.next=e}function L(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!Z(e)}function U(e){return e&&"function"==typeof e.next}function B(e){var t=Z(e);return t&&t.call(e)}function Z(e){var t=e&&(M&&e[M]||e[D]);if("function"==typeof t)return t}function V(e){return e&&"number"==typeof e.length}function W(e){return null==e?ae():a(e)?e.toSeq():ce(e)}function X(e){return null==e?ae().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function Y(e){return null==e?ae():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null==e?ae():a(e)?s(e)?e.entrySeq():e:ue(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=$,F.VALUES=Q,F.ENTRIES=I,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[N]=function(){return this},t(W,n),W.of=function(){return W(arguments)},W.prototype.toSeq=function(){return this},W.prototype.toString=function(){return this.__toString("Seq {","}")},W.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},W.prototype.__iterate=function(e,t){return fe(this,e,t,!0)},W.prototype.__iterator=function(e,t){return he(this,e,t,!0)},t(X,W),X.prototype.toKeyedSeq=function(){return this},t(Y,W),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return fe(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return he(this,e,t,!1)},t(G,W),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},W.isSeq=oe,W.Keyed=X,W.Set=G,W.Indexed=Y;var H,K,J,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function ie(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[ee])}function ae(){return H||(H=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():U(e)?new ie(e).fromEntrySeq():z(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ue(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ce(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function le(e){return V(e)?new te(e):U(e)?new ie(e):z(e)?new re(e):void 0}function fe(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function he(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new F((function(){var e=i[n?o-a:a];return a++>o?q():L(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function pe(e,t){return t?de(t,e,"",{"":e}):me(e)}function de(e,t,n,r){return Array.isArray(t)?e.call(r,n,Y(t).map((function(n,r){return de(e,n,r,t)}))):ve(t)?e.call(r,n,X(t).map((function(n,r){return de(e,n,r,t)}))):t}function me(e){return Array.isArray(e)?Y(e).map(me).toList():ve(e)?X(e).map(me).toMap():e}function ve(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ge(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ye(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every((function(e,t){var i=r.next().value;return i&&ge(i[1],e)&&(n||ge(i[0],t))}))&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var f=!0,h=t.__iterate((function(t,r){if(n?!e.has(t):i?!ge(t,e.get(r,b)):!ge(e.get(r,b),t))return f=!1,!1}));return f&&e.size===h}function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(K)return K;K=this}}function Oe(e,t){if(!e)throw new Error(t)}function we(e,t,n){if(!(this instanceof we))return new we(e,t,n);if(Oe(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?q():L(e,i,n[t?r-i++:i++])}))},t(ne,X),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new F((function(){var a=r[t?i-o:o];return o++>i?q():L(e,a,n[a])}))},ne.prototype[d]=!0,t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=B(this._iterable),r=0;if(U(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=B(this._iterable);if(!U(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:L(e,r++,t.value)}))},t(ie,Y),ie.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return L(e,i,r[i++])}))},t(be,Y),be.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},be.prototype.get=function(e,t){return this.has(e)?this._value:t},be.prototype.includes=function(e){return ge(this._value,e)},be.prototype.slice=function(e,t){var n=this.size;return j(e,t,n)?this:new be(this._value,A(t,n)-C(e,n))},be.prototype.reverse=function(){return this},be.prototype.indexOf=function(e){return ge(this._value,e)?0:-1},be.prototype.lastIndexOf=function(e){return ge(this._value,e)?this.size:-1},be.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?q():L(e,o++,a)}))},we.prototype.equals=function(e){return e instanceof we?this._start===e._start&&this._end===e._end&&this._step===e._step:ye(this,e)},t(xe,n),t(ke,xe),t(Se,xe),t(_e,xe),xe.Keyed=ke,xe.Indexed=Se,xe.Set=_e;var Pe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Ee(e){return e>>>1&1073741824|3221225471&e}function Te(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Ee(n)}if("string"===t)return e.length>Fe?je(e):Ce(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return Ae(e);if("function"==typeof e.toString)return Ce(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function je(e){var t=ze[e];return void 0===t&&(t=Ce(e),qe===Le&&(qe=0,ze={}),qe++,ze[e]=t),t}function Ce(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var Ie,Me="function"==typeof WeakMap;Me&&(Ie=new WeakMap);var De=0,Ne="__immutablehash__";"function"==typeof Symbol&&(Ne=Symbol(Ne));var Fe=16,Le=255,qe=0,ze={};function Ue(e){Oe(e!==1/0,"Cannot perform this action with an infinite size.")}function Be(e){return null==e?it():Ze(e)&&!l(e)?e:it().withMutations((function(t){var n=r(e);Ue(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Ze(e){return!(!e||!e[We])}t(Be,ke),Be.of=function(){var t=e.call(arguments,0);return it().withMutations((function(e){for(var n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},Be.prototype.toString=function(){return this.__toString("Map {","}")},Be.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Be.prototype.set=function(e,t){return ot(this,e,t)},Be.prototype.setIn=function(e,t){return this.updateIn(e,b,(function(){return t}))},Be.prototype.remove=function(e){return ot(this,e,b)},Be.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return b}))},Be.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Be.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=vt(this,xn(e),t,n);return r===b?void 0:r},Be.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):it()},Be.prototype.merge=function(){return ht(this,void 0,arguments)},Be.prototype.mergeWith=function(t){return ht(this,t,e.call(arguments,1))},Be.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,it(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Be.prototype.mergeDeep=function(){return ht(this,pt,arguments)},Be.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return ht(this,dt(t),n)},Be.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,it(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Be.prototype.sort=function(e){return zt(fn(this,e))},Be.prototype.sortBy=function(e,t){return zt(fn(this,t,e))},Be.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Be.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new S)},Be.prototype.asImmutable=function(){return this.__ensureOwner()},Be.prototype.wasAltered=function(){return this.__altered},Be.prototype.__iterator=function(e,t){return new et(this,e,t)},Be.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Be.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?rt(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Be.isMap=Ze;var Ve,We="@@__IMMUTABLE_MAP__@@",Xe=Be.prototype;function Ye(e,t){this.ownerID=e,this.entries=t}function Ge(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function He(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ke(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function et(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&nt(e._root)}function tt(e,t){return L(e,t[0],t[1])}function nt(e,t){return{node:e,index:0,__prev:t}}function rt(e,t,n,r){var i=Object.create(Xe);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function it(){return Ve||(Ve=rt(0))}function ot(e,t,n){var r,i;if(e._root){var o=x(O),a=x(w);if(r=at(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===b?-1:1:0)}else{if(n===b)return e;i=1,r=new Ye(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?rt(i,r):it()}function at(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===b?e:(k(s),k(a),new Je(t,r,[i,o]))}function st(e){return e.constructor===Je||e.constructor===Ke}function ut(e,t,n,r,i){if(e.keyHash===r)return new Ke(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&y,s=(0===n?r:r>>>n)&y;return new Ge(t,1<>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new He(e,o+1,a)}function ht(e,t,n){for(var i=[],o=0;o>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function yt(e,t,n,r){var i=r?e:_(e);return i[t]=n,i}function bt(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s=wt)return ct(e,u,r,i);var h=e&&e===this.ownerID,p=h?u:_(u);return f?s?c===l-1?p.pop():p[c]=p.pop():p[c]=[r,i]:p.push([r,i]),h?(this.entries=p,this):new Ye(e,p)}},Ge.prototype.get=function(e,t,n,r){void 0===t&&(t=Te(n));var i=1<<((0===e?t:t>>>e)&y),o=this.bitmap;return 0==(o&i)?r:this.nodes[gt(o&i-1)].get(e+v,t,n,r)},Ge.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=Te(r));var s=(0===t?n:n>>>t)&y,u=1<=xt)return ft(e,h,c,s,d);if(l&&!d&&2===h.length&&st(h[1^f]))return h[1^f];if(l&&d&&1===h.length&&st(d))return d;var m=e&&e===this.ownerID,g=l?d?c:c^u:c|u,O=l?d?yt(h,f,d,m):Ot(h,f,m):bt(h,f,d,m);return m?(this.bitmap=g,this.nodes=O,this):new Ge(e,g,O)},He.prototype.get=function(e,t,n,r){void 0===t&&(t=Te(n));var i=(0===e?t:t>>>e)&y,o=this.nodes[i];return o?o.get(e+v,t,n,r):r},He.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=Te(r));var s=(0===t?n:n>>>t)&y,u=i===b,c=this.nodes,l=c[s];if(u&&!l)return this;var f=at(l,e,t+v,n,r,i,o,a);if(f===l)return this;var h=this.count;if(l){if(!f&&--h0&&r=0&&e>>t&y;if(r>=this.array.length)return new Tt([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-v,n))===a&&o)return this}if(o&&!i)return this;var s=Dt(this,e);if(!o)for(var u=0;u>>t&y;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((r=o&&o.removeAfter(e,t-v,n))===o&&i===this.array.length-1)return this}var a=Dt(this,e);return a.array.splice(i+1),r&&(a.array[i]=r),a};var jt,Ct,At={};function Rt(e,t){var n=e._origin,r=e._capacity,i=qt(r),o=e._tail;return a(e._root,e._level,0);function a(e,t,n){return 0===t?s(e,n):u(e,t,n)}function s(e,a){var s=a===i?o&&o.array:e&&e.array,u=a>n?0:n-a,c=r-a;return c>g&&(c=g),function(){if(u===c)return At;var e=t?--c:u++;return s&&s[e]}}function u(e,i,o){var s,u=e&&e.array,c=o>n?0:n-o>>i,l=1+(r-o>>i);return l>g&&(l=g),function(){for(;;){if(s){var e=s();if(e!==At)return e;s=null}if(c===l)return At;var n=t?--l:c++;s=a(u&&u[n],i-v,o+(n<=e.size||t<0)return e.withMutations((function(e){t<0?Ft(e,t).set(0,n):Ft(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,i=e._root,o=x(w);return t>=qt(e._capacity)?r=Mt(r,e.__ownerID,0,t,n,o):i=Mt(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):$t(e._origin,e._capacity,e._level,i,r):e}function Mt(e,t,n,r,i,o){var a,s=r>>>n&y,u=e&&s0){var c=e&&e.array[s],l=Mt(c,t,n-v,r,i,o);return l===c?e:((a=Dt(e,t)).array[s]=l,a)}return u&&e.array[s]===i?e:(k(o),a=Dt(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function Dt(e,t){return t&&e&&t===e.ownerID?e:new Tt(e?e.array.slice():[],t)}function Nt(e,t){if(t>=qt(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&y],r-=v;return n}}function Ft(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new S,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,c=e._root,l=0;a+l<0;)c=new Tt(c&&c.array.length?[void 0,c]:[],r),l+=1<<(u+=v);l&&(a+=l,i+=l,s+=l,o+=l);for(var f=qt(o),h=qt(s);h>=1<f?new Tt([],r):p;if(p&&h>f&&av;g-=v){var b=f>>>g&y;m=m.array[b]=Dt(m.array[b],r)}m.array[f>>>v&y]=p}if(s=h)a-=h,s-=h,u=v,c=null,d=d&&d.removeBefore(r,0,a);else if(a>i||h>>u&y;if(O!==h>>>u&y)break;O&&(l+=(1<i&&(c=c.removeBefore(r,u,a-l)),c&&ho&&(o=c.size),a(u)||(c=c.map((function(e){return pe(e)}))),r.push(c)}return o>e.size&&(e=e.setSize(o)),mt(e,t,r)}function qt(e){return e>>v<=g&&a.size>=2*o.size?(r=(i=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):Bt(r,i)}function Wt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Xt(e){this._iter=e,this.size=e.size}function Yt(e){this._iter=e,this.size=e.size}function Gt(e){this._iter=e,this.size=e.size}function Ht(e){var t=bn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=On,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(t===I){var r=e.__iterator(t,n);return new F((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(t===Q?$:Q,n)},t}function Kt(e,t,n){var r=bn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,b);return o===b?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate((function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)}),i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(I,i);return new F((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return L(r,s,t.call(n,a[1],s,e),i)}))},r}function Jt(e,t){var n=bn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Ht(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=On,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function en(e,t,n,r){var i=bn(e);return r&&(i.has=function(r){var i=e.get(r,b);return i!==b&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,b);return o!==b&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(I,o),s=0;return new F((function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,c=u[0],l=u[1];if(t.call(n,l,c,e))return L(i,r?c:s++,l,o)}}))},i}function tn(e,t,n){var r=Be().asMutable();return e.__iterate((function(i,o){r.update(t.call(n,i,o,e),0,(function(e){return e+1}))})),r.asImmutable()}function nn(e,t,n){var r=s(e),i=(l(e)?zt():Be()).asMutable();e.__iterate((function(o,a){i.update(t.call(n,o,a,e),(function(e){return(e=e||[]).push(r?[a,o]:o),e}))}));var o=yn(e);return i.map((function(t){return mn(e,o(t))}))}function rn(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),j(t,n,i))return e;var o=C(t,i),a=A(n,i);if(o!=o||a!=a)return rn(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u==u&&(s=u<0?0:u);var c=bn(e);return c.size=0===s?s:e.size&&s||void 0,!r&&oe(e)&&s>=0&&(c.get=function(t,n){return(t=E(this,t))>=0&&ts)return q();var e=i.next();return r||t===Q?e:L(t,u-1,t===$?void 0:e.value[1],e)}))},c}function on(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate((function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)})),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(I,i),s=!0;return new F((function(){if(!s)return q();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],c=i[1];return t.call(n,c,u,o)?r===I?e:L(r,u,c,e):(s=!1,q())}))},r}function an(e,t,n,r){var i=bn(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate((function(e,o,c){if(!s||!(s=t.call(n,e,o,c)))return u++,i(e,r?o:u-1,a)})),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(I,o),u=!0,c=0;return new F((function(){var e,o,l;do{if((e=s.next()).done)return r||i===Q?e:L(i,c++,i===$?void 0:e.value[1],e);var f=e.value;o=f[0],l=f[1],u&&(u=t.call(n,l,o,a))}while(u);return i===I?e:L(i,o,l,e)}))},i}function sn(e,t){var n=s(e),i=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?se(e):ue(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||n&&s(o)||u(e)&&u(o))return o}var c=new te(i);return n?c=c.toKeyedSeq():u(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),c}function un(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,i){var o=0,s=!1;function u(e,c){var l=this;e.__iterate((function(e,i){return(!t||c0}function dn(e,t,r){var i=bn(e);return i.size=new te(r).map((function(e){return e.size})).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(Q,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map((function(e){return e=n(e),B(i?e.reverse():e)})),a=0,s=!1;return new F((function(){var n;return s||(n=o.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?q():L(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},i}function mn(e,t){return oe(e)?t:e.constructor(t)}function vn(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function gn(e){return Ue(e.size),P(e)}function yn(e){return s(e)?r:u(e)?i:o}function bn(e){return Object.create((s(e)?X:u(e)?Y:G).prototype)}function On(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):W.prototype.cacheResult.call(this)}function wn(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Xn(e,t)},Un.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;Ue(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Xn(t,n)},Un.prototype.pop=function(){return this.slice(1)},Un.prototype.unshift=function(){return this.push.apply(this,arguments)},Un.prototype.unshiftAll=function(e){return this.pushAll(e)},Un.prototype.shift=function(){return this.pop.apply(this,arguments)},Un.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Yn()},Un.prototype.slice=function(e,t){if(j(e,t,this.size))return this;var n=C(e,this.size);if(A(t,this.size)!==this.size)return Se.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Xn(r,i)},Un.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Xn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Un.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Un.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F((function(){if(r){var t=r.value;return r=r.next,L(e,n++,t)}return q()}))},Un.isStack=Bn;var Zn,Vn="@@__IMMUTABLE_STACK__@@",Wn=Un.prototype;function Xn(e,t,n,r){var i=Object.create(Wn);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Yn(){return Zn||(Zn=Xn(0))}function Gn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}Wn[Vn]=!0,Wn.withMutations=Xe.withMutations,Wn.asMutable=Xe.asMutable,Wn.asImmutable=Xe.asImmutable,Wn.wasAltered=Xe.wasAltered,n.Iterator=F,Gn(n,{toArray:function(){Ue(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Xt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Wt(this,!0)},toMap:function(){return Be(this.toKeyedSeq())},toObject:function(){Ue(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return zt(this.toKeyedSeq())},toOrderedSet:function(){return Dn(s(this)?this.valueSeq():this)},toSet:function(){return jn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Yt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Un(s(this)?this.valueSeq():this)},toList:function(){return St(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return mn(this,sn(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return ge(t,e)}))},entries:function(){return this.__iterator(I)},every:function(e,t){Ue(this.size);var n=!0;return this.__iterate((function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1})),n},filter:function(e,t){return mn(this,en(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Ue(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Ue(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator($)},map:function(e,t){return mn(this,Kt(this,e,t))},reduce:function(e,t,n){var r,i;return Ue(this.size),arguments.length<2?i=!0:r=t,this.__iterate((function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return mn(this,Jt(this,!0))},slice:function(e,t){return mn(this,rn(this,e,t,!0))},some:function(e,t){return!this.every(tr(e),t)},sort:function(e){return mn(this,fn(this,e))},values:function(){return this.__iterator(Q)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return P(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return tn(this,e,t)},equals:function(e){return ye(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(er).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(tr(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(T)},flatMap:function(e,t){return mn(this,cn(this,e,t))},flatten:function(e){return mn(this,un(this,e,!0))},fromEntrySeq:function(){return new Gt(this)},get:function(e,t){return this.find((function(t,n){return ge(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,i=xn(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,b):b)===b)return t}return r},groupBy:function(e,t){return nn(this,e,t)},has:function(e){return this.get(e,b)!==b},hasIn:function(e){return this.getIn(e,b)!==b},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ge(t,e)}))},keySeq:function(){return this.toSeq().map(Jn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return hn(this,e)},maxBy:function(e,t){return hn(this,t,e)},min:function(e){return hn(this,e?nr(e):or)},minBy:function(e,t){return hn(this,t?nr(t):or,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return mn(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return mn(this,an(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(tr(e),t)},sortBy:function(e,t){return mn(this,fn(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return mn(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return mn(this,on(this,e,t))},takeUntil:function(e,t){return this.takeWhile(tr(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ar(this))}});var Hn=n.prototype;Hn[f]=!0,Hn[N]=Hn.values,Hn.__toJS=Hn.toArray,Hn.__toStringMapper=rr,Hn.inspect=Hn.toSource=function(){return this.toString()},Hn.chain=Hn.flatMap,Hn.contains=Hn.includes,Gn(r,{flip:function(){return mn(this,Ht(this))},mapEntries:function(e,t){var n=this,r=0;return mn(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return mn(this,this.toSeq().flip().map((function(r,i){return e.call(t,r,i,n)})).flip())}});var Kn=r.prototype;function Jn(e,t){return t}function er(e,t){return[t,e]}function tr(e){return function(){return!e.apply(this,arguments)}}function nr(e){return function(){return-e.apply(this,arguments)}}function rr(e){return"string"==typeof e?JSON.stringify(e):String(e)}function ir(){return _(arguments)}function or(e,t){return et?-1:0}function ar(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return sr(e.__iterate(n?t?function(e,t){r=31*r+ur(Te(e),Te(t))|0}:function(e,t){r=r+ur(Te(e),Te(t))|0}:t?function(e){r=31*r+Te(e)|0}:function(e){r=r+Te(e)|0}),r)}function sr(e,t){return t=Pe(t,3432918353),t=Pe(t<<15|t>>>-15,461845907),t=Pe(t<<13|t>>>-13,5),t=Pe((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Ee((t=Pe(t^t>>>13,3266489909))^t>>>16)}function ur(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Kn[h]=!0,Kn[N]=Hn.entries,Kn.__toJS=Hn.toObject,Kn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+rr(e)},Gn(i,{toKeyedSeq:function(){return new Wt(this,!1)},filter:function(e,t){return mn(this,en(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return mn(this,Jt(this,!1))},slice:function(e,t){return mn(this,rn(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=C(e,e<0?this.count():this.size);var r=this.slice(0,e);return mn(this,1===n?r:r.concat(_(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return mn(this,un(this,e,!1))},get:function(e,t){return(e=E(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=E(this,e))>=0&&(void 0!==this.size?this.size===1/0||e=f){var t=console[e]||console.log;return t.apply(console,arguments)}}}!function(e){e.debug=h("debug"),e.log=h("log"),e.warn=h("warn"),e.error=h("error")}(c||(c={}));var p=n(769),d=n(615),m=n(576);function v(e){return function(t){for(var n=[],r=1;r"}}function w(e,t){if(void 0===t&&(t=[]),e)return d.a[b]&&d.a[b](e,t.map(O))}function x(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:p.a,message:e,args:t.map(O)})))}var k=n(441),S=!1!==globalThis.__DEV__},185:function(e,t,n){"use strict";n.r(t),n.d(t,"autoCloseTags",(function(){return G})),n.d(t,"completionPath",(function(){return D})),n.d(t,"esLint",(function(){return H})),n.d(t,"javascript",(function(){return W})),n.d(t,"javascriptLanguage",(function(){return F})),n.d(t,"jsxLanguage",(function(){return z})),n.d(t,"localCompletionSource",(function(){return I})),n.d(t,"scopeCompletionSource",(function(){return N})),n.d(t,"snippets",(function(){return _})),n.d(t,"tsxLanguage",(function(){return U})),n.d(t,"typescriptLanguage",(function(){return q})),n.d(t,"typescriptSnippets",(function(){return P}));var r=n(101),i=n(5),o=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],a=new r.a({start:!1,shift:function(e,t){return 5==t||6==t||315==t?e:316==t},strict:!1}),s=new r.b((function(e,t){var n=e.next;(125==n||-1==n||t.context)&&e.acceptToken(313)}),{contextual:!0,fallback:!0}),u=new r.b((function(e,t){var n,r=e.next;o.indexOf(r)>-1||(47!=r||47!=(n=e.peek(1))&&42!=n)&&(125==r||59==r||-1==r||t.context||e.acceptToken(312))}),{contextual:!0}),c=new r.b((function(e,t){var n=e.next;if(43==n||45==n){if(e.advance(),n==e.next){e.advance();var r=!t.context&&t.canShift(1);e.acceptToken(r?1:2)}}else 63==n&&46==e.peek(1)&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(3))}),{contextual:!0});function l(e,t){return e>=65&&e<=90||e>=97&&e<=122||95==e||e>=192||!t&&e>=48&&e<=57}var f=new r.b((function(e,t){if(60==e.next&&t.dialectEnabled(0)&&(e.advance(),47!=e.next)){for(var n=0;o.indexOf(e.next)>-1;)e.advance(),n++;if(l(e.next,!0)){for(e.advance(),n++;l(e.next,!1);)e.advance(),n++;for(;o.indexOf(e.next)>-1;)e.advance(),n++;if(44==e.next)return;for(var r=0;;r++){if(7==r){if(!l(e.next,!0))return;break}if(e.next!="extends".charCodeAt(r))break;e.advance(),n++}}e.acceptToken(4,-n)}})),h=Object(i.c)({"get set async static":i.e.modifier,"for while do if else switch try catch finally return throw break continue default case":i.e.controlKeyword,"in of await yield void typeof delete instanceof":i.e.operatorKeyword,"let var const using function class extends":i.e.definitionKeyword,"import export from":i.e.moduleKeyword,"with debugger as new":i.e.keyword,TemplateString:i.e.special(i.e.string),super:i.e.atom,BooleanLiteral:i.e.bool,this:i.e.self,null:i.e.null,Star:i.e.modifier,VariableName:i.e.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":i.e.function(i.e.variableName),VariableDefinition:i.e.definition(i.e.variableName),Label:i.e.labelName,PropertyName:i.e.propertyName,PrivatePropertyName:i.e.special(i.e.propertyName),"CallExpression/MemberExpression/PropertyName":i.e.function(i.e.propertyName),"FunctionDeclaration/VariableDefinition":i.e.function(i.e.definition(i.e.variableName)),"ClassDeclaration/VariableDefinition":i.e.definition(i.e.className),PropertyDefinition:i.e.definition(i.e.propertyName),PrivatePropertyDefinition:i.e.definition(i.e.special(i.e.propertyName)),UpdateOp:i.e.updateOperator,"LineComment Hashbang":i.e.lineComment,BlockComment:i.e.blockComment,Number:i.e.number,String:i.e.string,Escape:i.e.escape,ArithOp:i.e.arithmeticOperator,LogicOp:i.e.logicOperator,BitOp:i.e.bitwiseOperator,CompareOp:i.e.compareOperator,RegExp:i.e.regexp,Equals:i.e.definitionOperator,Arrow:i.e.function(i.e.punctuation),": Spread":i.e.punctuation,"( )":i.e.paren,"[ ]":i.e.squareBracket,"{ }":i.e.brace,"InterpolationStart InterpolationEnd":i.e.special(i.e.brace),".":i.e.derefOperator,", ;":i.e.separator,"@":i.e.meta,TypeName:i.e.typeName,TypeDefinition:i.e.definition(i.e.typeName),"type enum interface implements namespace module declare":i.e.definitionKeyword,"abstract global Privacy readonly override":i.e.modifier,"is keyof unique infer":i.e.operatorKeyword,JSXAttributeValue:i.e.attributeValue,JSXText:i.e.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":i.e.angleBracket,"JSXIdentifier JSXNameSpacedName":i.e.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":i.e.attributeName,"JSXBuiltin/JSXIdentifier":i.e.standard(i.e.tagName)}),p={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},d={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},m={__proto__:null,"<":187},v=r.c.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:a,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[h],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n8192){var a,s=k(R(e,t.node));try{for(s.s();!(a=s.n()).done;){var u=a.value;r.push(u)}}catch(e){s.e(e)}finally{s.f()}return!1}})),E.set(t,r),r}var $=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Q=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function I(e){var t=Object(g.I)(e.state).resolveInner(e.pos,-1);if(Q.indexOf(t.name)>-1)return null;var n="VariableName"==t.name||t.to-t.from<20&&$.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;for(var r=[],i=t;i;i=i.parent)T.has(i.name)&&(r=r.concat(R(e.state.doc,i)));return{options:r,from:n?t.from:e.pos,validFor:$}}function M(e,t,n){for(var r,i=[];;){var o=t.firstChild,a=void 0;if("VariableName"==(null==o?void 0:o.name))return i.push(e(o)),{path:i.reverse(),name:n};if("MemberExpression"!=(null==o?void 0:o.name)||"PropertyName"!=(null===(r=a=o.lastChild)||void 0===r?void 0:r.name))return null;i.push(e(a)),t=o}}function D(e){var t=function(t){return e.state.doc.sliceString(t.from,t.to)},n=Object(g.I)(e.state).resolveInner(e.pos,-1);return"PropertyName"==n.name?M(t,n.parent,t(n)):"."!=n.name&&"?."!=n.name||"MemberExpression"!=n.parent.name?Q.indexOf(n.name)>-1?null:"VariableName"==n.name||n.to-n.from<20&&$.test(t(n))?{path:[],name:t(n)}:"MemberExpression"==n.name?M(t,n,""):e.explicit?{path:[],name:""}:null:M(t,n.parent,"")}function N(e){var t=new Map;return function(n){var r=D(n);if(!r)return null;var i,o=e,a=k(r.path);try{for(a.s();!(i=a.n()).done;){if(!(o=o[i.value]))return null}}catch(e){a.e(e)}finally{a.f()}var s=t.get(o);return s||t.set(o,s=function(e,t){for(var n=[],r=new Set,i=0;;i++){var o,a=k((Object.getOwnPropertyNames||Object.keys)(e));try{for(a.s();!(o=a.n()).done;){var s=o.value;if(/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(s)&&!r.has(s)){r.add(s);var u=void 0;try{u=e[s]}catch(e){continue}n.push({label:s,type:"function"==typeof u?/^[A-Z]/.test(s)?"class":t?"function":"method":t?"variable":"property",boost:-i})}}}catch(e){a.e(e)}finally{a.f()}var c=Object.getPrototypeOf(e);if(!c)return n;e=c}}(o,!r.path.length)),{from:n.pos-r.name.length,options:s,validFor:$}}}var F=g.c.define({name:"javascript",parser:v.configure({props:[g.A.add({IfStatement:Object(g.m)({except:/^\s*({|else\b)/}),TryStatement:Object(g.m)({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:g.r,SwitchBody:function(e){var t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Object(g.p)({closing:"}"}),ArrowFunction:function(e){return e.baseIndent+e.unit},"TemplateString BlockComment":function(){return null},"Statement Property":Object(g.m)({except:/^{/}),JSXElement:function(e){var t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape:function(e){var t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":function(e){return e.column(e.node.from)+e.unit}}),g.w.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":g.u,BlockComment:function(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),L={test:function(e){return/^JSX/.test(e.name)},facet:Object(g.o)({commentTokens:{block:{open:"{/*",close:"*/}"}}})},q=F.configure({dialect:"ts"},"typescript"),z=F.configure({dialect:"jsx",props:[g.G.add((function(e){return e.isTop?[L]:void 0}))]}),U=F.configure({dialect:"jsx ts",props:[g.G.add((function(e){return e.isTop?[L]:void 0}))]},"typescript"),B=function(e){return{label:e,type:"keyword"}},Z="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(B),V=Z.concat(["declare","implements","private","protected","public"].map(B));function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.jsx?e.typescript?U:z:e.typescript?q:F,n=e.typescript?P.concat(V):_.concat(Z);return new g.f(t,[F.data.of({autocomplete:Object(O.h)(Q,Object(O.f)(n))}),F.data.of({autocomplete:I}),e.jsx?G:[]])}function X(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=null==t?void 0:t.firstChild;r;r=r.nextSibling)if("JSXIdentifier"==r.name||"JSXBuiltin"==r.name||"JSXNamespacedName"==r.name||"JSXMemberExpression"==r.name)return e.sliceString(r.from,Math.min(r.to,n));return""}var Y="object"==("undefined"==typeof navigator?"undefined":x(navigator))&&/Android\b/.test(navigator.userAgent),G=b.c.inputHandler.of((function(e,t,n,r,i){if((Y?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||">"!=r&&"/"!=r||!F.isActiveAt(e.state,t,-1))return!1;var o=i(),a=o.state,s=a.changeByRange((function(e){var t,n,i=e.head,o=Object(g.I)(a).resolveInner(i-1,-1);if("JSXStartTag"==o.name&&(o=o.parent),a.doc.sliceString(i-1,i)!=r||"JSXAttributeValue"==o.name&&o.to>i);else{if(">"==r&&"JSXFragmentTag"==o.name)return{range:e,changes:{from:i,insert:""}};if("/"==r&&"JSXStartCloseTag"==o.name){var s=o.parent,u=s.parent;if(u&&s.from==i-2&&((n=X(a.doc,u.firstChild,i))||"JSXFragmentTag"==(null===(t=u.firstChild)||void 0===t?void 0:t.name))){var c="".concat(n,">");return{range:y.f.cursor(i+c.length,-1),changes:{from:i,insert:c}}}}else if(">"==r){var l=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(o);if(l&&"JSXOpenTag"==l.name&&!/^\/?>|^<\//.test(a.doc.sliceString(i,i+2))&&(n=X(a.doc,l,i)))return{range:e,changes:{from:i,insert:"")}}}}return{range:e}}));return!s.changes.empty&&(e.dispatch([o,a.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));function H(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((function(e,n){e.meta.docs.recommended&&(t.rules[n]=2)}))),function(n){var r,i=n.state,o=[],a=k(F.findRegions(i));try{for(a.s();!(r=a.n()).done;){var s,u=r.value,c=u.from,l=u.to,f=i.doc.lineAt(c),h={line:f.number-1,col:c-f.from,pos:c},p=k(e.verify(i.sliceDoc(c,l),t));try{for(p.s();!(s=p.n()).done;){var d=s.value;o.push(J(d,i.doc,h))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){a.e(e)}finally{a.f()}return o}}function K(e,t,n,r){return n.line(e+r.line).from+t+(1==e?r.col-1:-1)}function J(e,t,n){var r=K(e.line,e.column,t,n),i={from:r,to:null!=e.endLine&&1!=e.endColumn?K(e.endLine,e.endColumn,t,n):r,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:1==e.severity?"warning":"error"};if(e.fix){var o=e.fix,a=o.range,s=o.text,u=a[0]+n.pos-r,c=a[1]+n.pos-r;i.actions=[{name:"fix",apply:function(e,t){e.dispatch({changes:{from:t+u,to:t+c,insert:s},scrollIntoView:!0})}}]}return i}},187:function(e,t,n){"use strict";n.d(t,"a",(function(){return l.a})),n.d(t,"b",(function(){return I})),n.d(t,"c",(function(){return F}));const r=()=>Object.create(null),{forEach:i,slice:o}=Array.prototype,{hasOwnProperty:a}=Object.prototype;class s{constructor(e=!0,t=r){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return i.call(e,(e=>t=t.getChildTrie(e))),a.call(t,"data")?t.data:t.data=this.makeData(o.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&nt.push(e))),t};function v(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const g=[];function y(e,t){if(!e)throw new Error(t||"assertion failure")}function b(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function O(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function w(e){return e.slice(0)}class x{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++x.count}peek(){if(1===this.value.length&&!_(this))return k(this),this.value[0]}recompute(e){return y(!this.recomputing,"already recomputing"),k(this),_(this)?function(e,t){R(e),p.withValue(e,S,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{v(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,_(e))return;E(e)}(e);return O(e.value)}(this,e):O(this.value)}setDirty(){this.dirty||(this.dirty=!0,P(this),v(this))}dispose(){this.setDirty(),R(this),T(this,((e,t)=>{e.setDirty(),$(e,this)}))}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=g.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(m(this.deps).forEach((e=>e.delete(this))),this.deps.clear(),g.push(this.deps),this.deps=null)}}function k(e){const t=p.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),_(e)?j(t,e):C(t,e),t}function S(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=w(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!b(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(e){}}catch(t){e.value[1]=t}e.recomputing=!1}function _(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function P(e){T(e,j)}function E(e){T(e,C)}function T(e,t){const n=e.parents.size;if(n){const r=m(e.parents);for(let i=0;i0&&e.childValues.forEach(((t,n)=>{$(e,n)})),e.forgetDeps(),y(null===e.dirtyChildren)}function $(e,t){t.parents.delete(e),e.childValues.delete(t),A(e,t)}x.count=0;const Q={setDirty:!0,dispose:!0,forget:!0};function I(e){const t=new Map,n=e&&e.subscribe;function r(e){const r=p.getValue();if(r){let i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(v(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&d.call(Q,n)?n:"setDirty";m(r).forEach((e=>e[i]())),t.delete(e),v(r)}},r}let M;function D(...e){return(M||(M=new s("function"==typeof WeakMap))).lookupArray(e)}const N=new Set;function F(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=D,normalizeResult:i,subscribe:o,cache:a=c.a}=Object.create(null)){const s="function"==typeof a?new a(t,(e=>e.dispose())):a,u=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let a=s.get(t);a||(s.set(t,a=new x(e)),a.normalizeResult=i,a.subscribe=o,a.forget=()=>s.delete(t));const u=a.recompute(Array.prototype.slice.call(arguments));return s.set(t,a),N.add(s),p.hasValue()||(N.forEach((e=>e.clean())),N.clear()),u};function l(e){const t=e&&s.get(e);t&&t.setDirty()}function f(e){const t=e&&s.get(e);if(t)return t.peek()}function h(e){return!!e&&s.delete(e)}return Object.defineProperty(u,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(u.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:o,cache:s}),u.dirtyKey=l,u.dirty=function(){l(r.apply(null,arguments))},u.peekKey=f,u.peek=function(){return f(r.apply(null,arguments))},u.forgetKey=h,u.forget=function(){return h(r.apply(null,arguments))},u.makeCacheKey=r,u.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(u)}},205:function(e,t,n){"use strict";n.r(t),n.d(t,"autoCloseTags",(function(){return we})),n.d(t,"html",(function(){return be})),n.d(t,"htmlCompletionSource",(function(){return he})),n.d(t,"htmlCompletionSourceWith",(function(){return pe})),n.d(t,"htmlLanguage",(function(){return ye})),n.d(t,"htmlPlain",(function(){return ge}));var r=n(101),i=n(5),o=n(27);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=65&&i<=90||95==i||i>=97&&i<=122||i>=161;)o+=String.fromCharCode(r),r=e.peek(++t);return p=e,d=n,h=o?o.toLowerCase():r==v||r==g?void 0:null}var v=63,g=33;function y(e,t){this.name=e,this.parent=t}var b=[6,10,7,8,9],O=new r.a({start:null,shift:function(e,t,n,r){return b.indexOf(t)>-1?new y(m(r,1)||"",e):e},reduce:function(e,t){return 20==t&&e?e.parent:e},reuse:function(e,t,n,r){var i=t.type.id;return 6==i||36==i?new y(m(r,1)||"",e):e},strict:!1}),w=new r.b((function(e,t){if(60==e.next){e.advance();var n=47==e.next;n&&e.advance();var r=m(e,0);if(void 0!==r){if(!r)return e.acceptToken(n?14:6);var i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(11);if(i&&c[i])return e.acceptToken(57,-2);if(t.dialectEnabled(0))return e.acceptToken(12);for(var o=t.context;o;o=o.parent)if(o.name==r)return;e.acceptToken(13)}else{if("script"==r)return e.acceptToken(7);if("style"==r)return e.acceptToken(8);if("textarea"==r)return e.acceptToken(9);if(u.hasOwnProperty(r))return e.acceptToken(10);i&&l[i]&&l[i][r]?e.acceptToken(57,-1):e.acceptToken(6)}}}else e.next<0&&t.context&&e.acceptToken(57)}),{contextual:!0}),x=new r.b((function(e){for(var t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(58);break}if(45==e.next)t++;else{if(62==e.next&&t>=2){n>=3&&e.acceptToken(58,-2);break}t=0}e.advance()}}));var k=new r.b((function(e,t){if(47==e.next&&62==e.peek(1)){var n=t.dialectEnabled(1)||function(e){for(;e;e=e.parent)if("svg"==e.name||"math"==e.name)return!0;return!1}(t.context);e.acceptToken(n?5:4,2)}else 62==e.next&&e.acceptToken(4,1)}));function S(e,t,n){var i=2+e.length;return new r.b((function(r){for(var o=0,a=0,s=0;;s++){if(r.next<0){s&&r.acceptToken(t);break}if(0==o&&60==r.next||1==o&&47==r.next||o>=2&&oa?r.acceptToken(t,-a):r.acceptToken(n,-(a-2));break}if((10==r.next||13==r.next)&&s){r.acceptToken(t,1);break}o=a=0}else a++;r.advance()}}))}var _=S("script",54,1),P=S("style",55,2),E=S("textarea",56,3),T=Object(i.c)({"Text RawText":i.e.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":i.e.angleBracket,TagName:i.e.tagName,"MismatchedCloseTag/TagName":[i.e.tagName,i.e.invalid],AttributeName:i.e.attributeName,"AttributeValue UnquotedAttributeValue":i.e.attributeValue,Is:i.e.definitionOperator,"EntityReference CharacterReference":i.e.character,Comment:i.e.blockComment,ProcessingInst:i.e.processingInstruction,DoctypeDecl:i.e.documentMeta}),j=r.c.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:O,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[T],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[],i=[],s=[],u=[],c=a(t);try{for(c.s();!(e=c.n()).done;){var l=e.value,f="script"==l.tag?r:"style"==l.tag?i:"textarea"==l.tag?s:u;f.push(l)}}catch(e){c.e(e)}finally{c.f()}var h,p=n.length?Object.create(null):null,d=a(n);try{for(d.s();!(h=d.n()).done;){var m=h.value;(p[m.name]||(p[m.name]=[])).push(m)}}catch(e){d.e(e)}finally{d.f()}return Object(o.j)((function(e,t){var n=e.type.id;if(28==n)return R(e,t,r);if(31==n)return R(e,t,i);if(34==n)return R(e,t,s);if(20==n&&u.length){var o,c=e.node,l=c.firstChild,f=l&&A(l,t);if(f)for(var h=0,d=u;hl.to)return{parser:m.parser,overlay:[{from:l.to,to:g}]}}}}if(p&&23==n){var y,b=e.node;if(y=b.firstChild){var O=p[t.read(y.from,y.to)];if(O){var w,x=a(O);try{for(x.s();!(w=x.n()).done;){var k=w.value;if(!k.tagName||k.tagName==A(b.parent,t)){var S=b.lastChild;if(26==S.type.id){var _=S.from+1,P=S.lastChild,E=S.to-(P&&P.isError?0:1);if(E>_)return{parser:k.parser,overlay:[{from:_,to:E}]}}else if(27==S.type.id)return{parser:k.parser,overlay:[{from:S.from,to:S.to}]}}}}catch(e){x.e(e)}finally{x.f()}}}}return null}))}var Q=n(156),I=n(185),M=n(11),D=n(7),N=n(9);function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function L(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:e.length;if(!t)return"";var r=t.firstChild,i=r&&r.getChild("TagName");return i?e.sliceString(i.from,Math.min(i.to,n)):""}function oe(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e;e=e.parent)if("Element"==e.name){if(!t)return e;t=!1}return null}function ae(e,t,n){var r=n.tags[ie(e,oe(t))];return(null==r?void 0:r.children)||n.allTags}function se(e,t){for(var n=[],r=oe(t);r&&!r.type.isTop;r=oe(r.parent)){var i=ie(e,r);if(i&&"CloseTag"==r.lastChild.name)break;i&&n.indexOf(i)<0&&("EndTag"==t.name||t.from>=r.firstChild.to)&&n.push(i)}return n}re.default=new re;var ue=/^[:\-\.\w\u00b7-\uffff]*$/;function ce(e,t,n,r,i){var o=/\s*>/.test(e.sliceDoc(i,i+5))?"":">",a=oe(n,!0);return{from:r,to:i,options:ae(e.doc,a,t).map((function(e){return{label:e,type:"type"}})).concat(se(e.doc,n).map((function(e,t){return{label:"/"+e,apply:"/"+e+o,type:"type",boost:99-t}}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function le(e,t,n,r){var i=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:se(e.doc,t).map((function(e,t){return{label:e,apply:e+i,type:"type",boost:99-t}})),validFor:ue}}function fe(e,t){for(var n,r=t.state,i=t.pos,o=Object(N.I)(r).resolveInner(i,-1),a=o.resolve(i),s=i;a==o&&(n=o.childBefore(s));){var u=n.lastChild;if(!u||!u.type.isError||u.from='"]*$/;var v,g=U(l);try{for(g.s();!(v=g.n()).done;){var y=v.value;s.push({label:y,apply:d+y+m,type:"constant"})}}catch(e){g.e(e)}finally{g.f()}}}return{from:r,to:i,options:s,validFor:u}}(r,e,o,"Is"==o.name?i:o.from,i):!t.explicit||"Element"!=a.name&&"Text"!=a.name&&"Document"!=a.name?null:function(e,t,n,r){var i,o=[],a=0,s=U(ae(e.doc,n,t));try{for(s.s();!(i=s.n()).done;){var u=i.value;o.push({label:"<"+u,type:"type"})}}catch(e){s.e(e)}finally{s.f()}var c,l=U(se(e.doc,n));try{for(l.s();!(c=l.n()).done;){var f=c.value;o.push({label:"",type:"type",boost:99-a++})}}catch(e){l.e(e)}finally{l.f()}return{from:r,to:r,options:o,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(r,e,o,i)}function he(e){return fe(re.default,e)}function pe(e){var t=e.extraTags,n=e.extraGlobalAttributes,r=n||t?new re(t,n):re.default;return function(e){return fe(r,e)}}var de=I.javascriptLanguage.parser.configure({top:"SingleExpression"}),me=[{tag:"script",attrs:function(e){return"text/typescript"==e.type||"ts"==e.lang},parser:I.typescriptLanguage.parser},{tag:"script",attrs:function(e){return"text/babel"==e.type||"text/jsx"==e.type},parser:I.jsxLanguage.parser},{tag:"script",attrs:function(e){return"text/typescript-jsx"==e.type},parser:I.tsxLanguage.parser},{tag:"script",attrs:function(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:de},{tag:"script",attrs:function(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:I.javascriptLanguage.parser},{tag:"style",attrs:function(e){return(!e.lang||"css"==e.lang)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:Q.cssLanguage.parser}],ve=[{name:"style",parser:Q.cssLanguage.parser.configure({top:"Styles"})}].concat(ee.map((function(e){return{name:e,parser:I.javascriptLanguage.parser}}))),ge=N.c.define({name:"html",parser:j.configure({props:[N.A.add({Element:function(e){var t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag":function(e){return e.column(e.node.from)+e.unit},Document:function(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length0&&void 0!==arguments[0]?arguments[0]:{},n="";!1===t.matchClosingTags&&(n="noMatch"),!0===t.selfClosingTags&&(n=(n?n+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(e=$((t.nestedLanguages||[]).concat(me),(t.nestedAttributes||[]).concat(ve)));var r=e?ge.configure({wrap:e,dialect:n}):n?ye.configure({dialect:n}):ye;return new N.f(r,[ye.data.of({autocomplete:pe(t)}),!1!==t.autoCloseTags?we:[],Object(I.javascript)().support,Object(Q.css)().support])}var Oe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),we=M.c.inputHandler.of((function(e,t,n,r,i){if(e.composing||e.state.readOnly||t!=n||">"!=r&&"/"!=r||!ye.isActiveAt(e.state,t,-1))return!1;var o=i(),a=o.state,s=a.changeByRange((function(e){var t,n,i,o,s=a.doc.sliceString(e.from-1,e.to)==r,u=e.head,c=Object(N.I)(a).resolveInner(u,-1);if(s&&">"==r&&"EndTag"==c.name){var l=c.parent;if("CloseTag"!=(null===(n=null===(t=l.parent)||void 0===t?void 0:t.lastChild)||void 0===n?void 0:n.name)&&(o=ie(a.doc,l.parent,u))&&!Oe.has(o))return{range:e,changes:{from:u,to:u+(">"===a.doc.sliceString(u,u+1)?1:0),insert:"")}}}else if(s&&"/"==r&&"IncompleteCloseTag"==c.name){var f=c.parent;if(c.from==u-2&&"CloseTag"!=(null===(i=f.lastChild)||void 0===i?void 0:i.name)&&(o=ie(a.doc,f,u))&&!Oe.has(o)){var h=u+(">"===a.doc.sliceString(u,u+1)?1:0),p="".concat(o,">");return{range:D.f.cursor(u+p.length,-1),changes:{from:u,to:h,insert:p}}}}return{range:e}}));return!s.changes.empty&&(e.dispatch([o,a.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}))},213:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},218:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r="Invariant failed";function i(e,t){if(!e)throw new Error(r)}},219:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s}));var r=n(487),i=n(92),o=n(69);function a(e){const t=Object(r.b)(),n={sid:Object(i.f)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Object(o.c)({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&s(n,e),n}function s(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Object(r.b)(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Object(i.f)()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function u(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),s(e,n)}},22:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return B}));var r=n(0),i=n.n(r),o=i.a.createContext(null);var a=function(e){e()};function s(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var u={notify:function(){},get:function(){return[]}};function c(e,t){var n,r=u;function i(){a.onStateChange&&a.onStateChange()}function o(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=s())}var a={addNestedSub:function(e){return o(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return Boolean(n)},trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=u)},getListeners:function(){return r}};return a}var l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;var f=function(e){var t=e.store,n=e.context,a=e.children,s=Object(r.useMemo)((function(){var e=c(t);return{store:t,subscription:e}}),[t]),u=Object(r.useMemo)((function(){return t.getState()}),[t]);l((function(){var e=s.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),u!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[s,u]);var f=n||o;return i.a.createElement(f.Provider,{value:s},a)},h=n(64),p=n(118),d=n(619),m=n.n(d),v=n(864),g=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],y=["reactReduxForwardedRef"],b=[],O=[null,null];function w(e,t){var n=e[1];return[t.payload,n+1]}function x(e,t,n){l((function(){return e.apply(void 0,t)}),n)}function k(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function S(e,t,n,r,i,o,a,s,u,c){if(e){var l=!1,f=null,h=function(){if(!l){var e,n,h=t.getState();try{e=r(h,i.current)}catch(e){n=e,f=e}n||(f=null),e===o.current?a.current||u():(o.current=e,s.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=h,n.trySubscribe(),h();return function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var _=function(){return[null,0]};function P(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,s=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,u=n.methodName,l=void 0===u?"connectAdvanced":u,f=n.renderCountProp,d=void 0===f?void 0:f,P=n.shouldHandleStateChanges,E=void 0===P||P,T=n.storeKey,j=void 0===T?"store":T,C=(n.withRef,n.forwardRef),A=void 0!==C&&C,R=n.context,$=void 0===R?o:R,Q=Object(p.a)(n,g),I=$;return function(t){var n=t.displayName||t.name||"Component",o=s(n),a=Object(h.a)({},Q,{getDisplayName:s,methodName:l,renderCountProp:d,shouldHandleStateChanges:E,storeKey:j,displayName:o,wrappedComponentName:n,WrappedComponent:t}),u=Q.pure;var f=u?r.useMemo:function(e){return e()};function g(n){var o=Object(r.useMemo)((function(){var e=n.reactReduxForwardedRef,t=Object(p.a)(n,y);return[n.context,e,t]}),[n]),s=o[0],u=o[1],l=o[2],d=Object(r.useMemo)((function(){return s&&s.Consumer&&Object(v.isContextConsumer)(i.a.createElement(s.Consumer,null))?s:I}),[s,I]),m=Object(r.useContext)(d),g=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(m)&&Boolean(m.store);var P=g?n.store:m.store,T=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,a)}(P)}),[P]),j=Object(r.useMemo)((function(){if(!E)return O;var e=c(P,g?null:m.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[P,g,m]),C=j[0],A=j[1],R=Object(r.useMemo)((function(){return g?m:Object(h.a)({},m,{subscription:C})}),[g,m,C]),$=Object(r.useReducer)(w,b,_),Q=$[0][0],M=$[1];if(Q&&Q.error)throw Q.error;var D=Object(r.useRef)(),N=Object(r.useRef)(l),F=Object(r.useRef)(),L=Object(r.useRef)(!1),q=f((function(){return F.current&&l===N.current?F.current:T(P.getState(),l)}),[P,Q,l]);x(k,[N,D,L,l,q,F,A]),x(S,[E,P,C,T,N,D,L,F,A,M],[P,C,T]);var z=Object(r.useMemo)((function(){return i.a.createElement(t,Object(h.a)({},q,{ref:u}))}),[u,t,q]);return Object(r.useMemo)((function(){return E?i.a.createElement(d.Provider,{value:R},z):z}),[d,z,R])}var P=u?i.a.memo(g):g;if(P.WrappedComponent=t,P.displayName=g.displayName=o,A){var T=i.a.forwardRef((function(e,t){return i.a.createElement(P,Object(h.a)({},e,{reactReduxForwardedRef:t}))}));return T.displayName=o,T.WrappedComponent=t,m()(T,t)}return m()(P,t)}}function E(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function T(e,t){if(E(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function z(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?P:n,i=t.mapStateToPropsFactories,o=void 0===i?$:i,a=t.mapDispatchToPropsFactories,s=void 0===a?R:a,u=t.mergePropsFactories,c=void 0===u?I:u,l=t.selectorFactory,f=void 0===l?F:l;return function(e,t,n,i){void 0===i&&(i={});var a=i,u=a.pure,l=void 0===u||u,d=a.areStatesEqual,m=void 0===d?z:d,v=a.areOwnPropsEqual,g=void 0===v?T:v,y=a.areStatePropsEqual,b=void 0===y?T:y,O=a.areMergedPropsEqual,w=void 0===O?T:O,x=Object(p.a)(a,L),k=q(e,o,"mapStateToProps"),S=q(t,s,"mapDispatchToProps"),_=q(n,c,"mergeProps");return r(f,Object(h.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:S,initMergeProps:_,pure:l,areStatesEqual:m,areOwnPropsEqual:g,areStatePropsEqual:b,areMergedPropsEqual:w},x))}}var B=U();var Z,V=n(75);Z=V.unstable_batchedUpdates,a=Z},239:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},240:function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return c}));var r=n(10),i=n(588),o={};function a(e,t){o[e]=t}var s=!1!==globalThis.__DEV__?function(){var e,t,n,a,s;if(!1===globalThis.__DEV__)throw new Error("only supported in development mode");return{limits:({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4},Object.fromEntries(Object.entries({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4}).map((function(e){var t=e[0],n=e[1];return[t,i.a[t]||n]})))),sizes:Object(r.__assign)({print:null===(e=o.print)||void 0===e?void 0:e.call(o),parser:null===(t=o.parser)||void 0===t?void 0:t.call(o),canonicalStringify:null===(n=o.canonicalStringify)||void 0===n?void 0:n.call(o),links:m(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:p(this.queryManager.documentTransform)}},null===(s=(a=this.cache).getMemoryInternals)||void 0===s?void 0:s.call(a))}}:void 0,u=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return Object(r.__assign)(Object(r.__assign)({},l.apply(this)),{addTypenameDocumentTransform:p(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:f(this.storeReader.executeSelectionSet),executeSubSelectedArray:f(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:f(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:f(null==e?void 0:e.findFragmentSpreads),lookup:f(null==e?void 0:e.lookup),transform:f(null==e?void 0:e.transform)}})}:void 0,c=!1!==globalThis.__DEV__?l:void 0;function l(){return{cache:{fragmentQueryDocuments:f(this.getFragmentDoc)}}}function f(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function h(e){return null!=e}function p(e){return d(e).map((function(e){return{cache:e}}))}function d(e){return e?Object(r.__spreadArray)(Object(r.__spreadArray)([f(null==e?void 0:e.performWork)],d(null==e?void 0:e.left),!0),d(null==e?void 0:e.right),!0).filter(h):[]}function m(e){var t;return e?Object(r.__spreadArray)(Object(r.__spreadArray)([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],m(null==e?void 0:e.left),!0),m(null==e?void 0:e.right),!0).filter(h):[]}},242:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return i}));var r=n(57);function i(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function o(e,t){let n=e;const r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let o=Math.min(i+140,r);return o>r-5&&(o=r),o===r&&(i=Math.max(o-140,0)),n=n.slice(i,o),i>0&&(n=`'{snip} ${n}`),ofunction(e,t,n=!1){return!!Object(r.m)(e)&&(Object(r.l)(t)?t.test(e):!!Object(r.m)(t)&&(n?e===t:e.includes(t)))}(e,t,n)))}},243:function(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw new Error(t)}n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return p}));function i(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:i(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,o=[];for(let r=0;r1&&o.push(`... ${r} more items`);return"["+o.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+i(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}class o{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class a{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const s={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},u=new Set(Object.keys(s));function c(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&u.has(t)}var l;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(l||(l={}));var f=n(36);const h=Object.freeze({});function p(e,t,n=s){const o=new Map;for(const e of Object.values(f.a))o.set(e,d(t,e));let a,u,l,p=Array.isArray(e),m=[e],v=-1,g=[],y=e;const b=[],O=[];do{v++;const e=v===m.length,s=e&&0!==g.length;if(e){if(u=0===O.length?void 0:b[b.length-1],y=l,l=O.pop(),s)if(p){y=y.slice();let e=0;for(const[t,n]of g){const r=t-e;null===n?(y.splice(r,1),e++):y[r]=n}}else{y=Object.defineProperties({},Object.getOwnPropertyDescriptors(y));for(const[e,t]of g)y[e]=t}v=a.index,m=a.keys,g=a.edits,p=a.inArray,a=a.prev}else if(l){if(u=p?v:m[v],y=l[u],null==y)continue;b.push(u)}let f;if(!Array.isArray(y)){var w,x;c(y)||r(!1,`Invalid AST Node: ${S=y,i(S,[])}.`);const n=e?null===(w=o.get(y.kind))||void 0===w?void 0:w.leave:null===(x=o.get(y.kind))||void 0===x?void 0:x.enter;if(f=null==n?void 0:n.call(t,y,u,l,b,O),f===h)break;if(!1===f){if(!e){b.pop();continue}}else if(void 0!==f&&(g.push([u,f]),!e)){if(!c(f)){b.pop();continue}y=f}}var k;if(void 0===f&&s&&g.push([u,y]),e)b.pop();else a={inArray:p,index:v,keys:m,edits:g,prev:a},p=Array.isArray(y),m=p?y:null!==(k=n[y.kind])&&void 0!==k?k:[],v=-1,g=[],l&&O.push(l),l=y}while(void 0!==a);var S;return 0!==g.length?g[g.length-1][1]:e}function d(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}},25:function(e,t,n){"use strict";var r,i=n(17),o="<>",a=function(){invariant(!1,"ImmutablePropTypes type checking code is stripped in production.")};a.isRequired=a;var s=function(){return a};function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof i.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function c(e){function t(t,n,r,i,a,s){for(var u=arguments.length,c=Array(u>6?u-6:0),l=6;l=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),this.id=y++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function")}}return d(e,[{key:"add",value:function(e){var t=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=k.match(e)),function(n){var r=e(n);return void 0===r?null:[t,r]}}}]),e}();O.closedBy=new O({deserialize:function(e){return e.split(" ")}}),O.openedBy=new O({deserialize:function(e){return e.split(" ")}}),O.group=new O({deserialize:function(e){return e.split(" ")}}),O.isolate=new O({deserialize:function(e){if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),O.contextHash=new O({perNode:!0}),O.lookAhead=new O({perNode:!0}),O.mounted=new O({perNode:!0});var w=function(){function e(t,n,r){v(this,e),this.tree=t,this.overlay=n,this.parser=r}return d(e,null,[{key:"get",value:function(e){return e&&e.props&&e.props[O.mounted.id]}}]),e}(),x=Object.create(null),k=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;v(this,e),this.name=t,this.props=n,this.id=r,this.flags=i}return d(e,[{key:"prop",value:function(e){return this.props[e.id]}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}},{key:"is",value:function(e){if("string"==typeof e){if(this.name==e)return!0;var t=this.prop(O.group);return!!t&&t.indexOf(e)>-1}return this.id==e}}],[{key:"define",value:function(t){var n=t.props&&t.props.length?Object.create(null):x,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),i=new e(t.name||"",n,t.id,r);if(t.props){var o,a=l(t.props);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}}catch(e){a.e(e)}finally{a.f()}}return i}},{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,i=l(n.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value;t[o]=e[n]}}catch(e){i.e(e)}finally{i.f()}}return function(e){for(var n=e.prop(O.group),r=-1;r<(n?n.length:0);r++){var i=t[r<0?e.name:n[r]];if(i)return i}}}}]),e}();k.none=new k("",Object.create(null),0,8);var S,_=function(){function e(t){v(this,e),this.types=t;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0;return new z(this.topNode,e)}},{key:"cursorAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=P.get(this)||this.topNode,r=new z(n);return r.moveTo(e,t),P.set(this,r._tree),r}},{key:"topNode",get:function(){return new Q(this,0,0,null)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=R(P.get(this)||this.topNode,e,t,!1);return P.set(this,n),n}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=R(E.get(this)||this.topNode,e,t,!0);return E.set(this,n),n}},{key:"resolveStack",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return q(this,e,t)}},{key:"iterate",value:function(e){for(var t=e.enter,n=e.leave,r=e.from,i=void 0===r?0:r,o=e.to,a=void 0===o?this.length:o,s=e.mode||0,u=(s&S.IncludeAnonymous)>0,c=this.cursor(s|S.IncludeAnonymous);;){var l=!1;if(c.from<=a&&c.to>=i&&(!u&&c.type.isAnonymous||!1!==t(c))){if(c.firstChild())continue;l=!0}for(;l&&n&&(u||!c.type.isAnonymous)&&n(c),!c.nextSibling();){if(!c.parent())return;l=!0}}}},{key:"prop",value:function(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}},{key:"propValues",get:function(){var e=[];if(this.props)for(var t in this.props)e.push([+t,this.props[t]]);return e}},{key:"balance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.children.length<=8?this:W(k.none,this.children,this.positions,0,this.children.length,0,this.length,(function(n,r,i){return new e(t.type,n,r,i,t.propValues)}),n.makeTree||function(t,n,r){return new e(k.none,t,n,r)})}}],[{key:"build",value:function(e){return B(e)}}]),e}();T.empty=new T(k.none,[],[],0);var j=function(){function e(t,n){v(this,e),this.buffer=t,this.index=n}return d(e,[{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}},{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}}]),e}(),C=function(){function e(t,n,r){v(this,e),this.buffer=t,this.length=n,this.set=r}return d(e,[{key:"type",get:function(){return k.none}},{key:"toString",value:function(){for(var e=[],t=0;t0));s=o[s+3]);return a}},{key:"slice",value:function(t,n,r){for(var i=this.buffer,o=new Uint16Array(n-t),a=0,s=t,u=0;s=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function R(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0&&void 0!==arguments[0]?arguments[0]:0;return new z(this,e)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=I(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return I(this,e,t,n)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return R(this,e,t,!1)}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return R(this,e,t,!0)}},{key:"matchContext",value:function(e){return M(this.parent,e)}},{key:"enterUnfinishedNodesBefore",value:function(e){for(var t=this.childBefore(e),n=this;t;){var r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(n=t,t=r.prevSibling):t=r}return n}},{key:"node",get:function(){return this}},{key:"next",get:function(){return this.parent}}]),e}(),Q=function(e){function t(e,n,r,o){var a;return v(this,t),(a=i(this,t))._tree=e,a.from=n,a.index=r,a._parent=o,a}return s(t,e),d(t,[{key:"type",get:function(){return this._tree.type}},{key:"name",get:function(){return this._tree.type.name}},{key:"to",get:function(){return this.from+this._tree.length}},{key:"nextChild",value:function(e,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=this;;){for(var s=a._tree,u=s.children,c=s.positions,l=n>0?u.length:-1;e!=l;e+=n){var f=u[e],h=c[e]+a.from;if(A(i,r,h,h+f.length))if(f instanceof C){if(o&S.ExcludeBuffers)continue;var p=f.findChild(0,f.buffer.length,n,r-h,i);if(p>-1)return new N(new D(a,f,e,h),null,p)}else if(o&S.IncludeAnonymous||!f.type.isAnonymous||U(f)){var d=void 0;if(!(o&S.IgnoreMounts)&&(d=w.get(f))&&!d.overlay)return new t(d.tree,h,e,a);var m=new t(f,h,e,a);return o&S.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?f.children.length-1:0,n,r,i)}}if(o&S.IncludeAnonymous||!a.type.isAnonymous)return null;if(e=a.index>=0?a.index+n:n<0?-1:a._parent._tree.children.length,!(a=a._parent))return null}}},{key:"firstChild",get:function(){return this.nextChild(0,1,0,4)}},{key:"lastChild",get:function(){return this.nextChild(this._tree.children.length-1,-1,0,4)}},{key:"childAfter",value:function(e){return this.nextChild(0,1,e,2)}},{key:"childBefore",value:function(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}},{key:"enter",value:function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(i&S.IgnoreOverlays)&&(r=w.get(this._tree))&&r.overlay){var o,a=e-this.from,s=l(r.overlay);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.from,f=u.to;if((n>0?c<=a:c=a:f>a))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}}catch(e){s.e(e)}finally{s.f()}}return this.nextChild(0,1,e,n,i)}},{key:"nextSignificantParent",value:function(){for(var e=this;e.type.isAnonymous&&e._parent;)e=e._parent;return e}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}},{key:"prevSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}},{key:"tree",get:function(){return this._tree}},{key:"toTree",value:function(){return this._tree}},{key:"toString",value:function(){return this._tree.toString()}}]),t}($);function I(e,t,n,r){var i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n)for(var a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function M(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length-1,r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var D=d((function e(t,n,r,i){v(this,e),this.parent=t,this.buffer=n,this.index=r,this.start=i})),N=function(e){function t(e,n,r){var o;return v(this,t),(o=i(this,t)).context=e,o._parent=n,o.index=r,o.type=e.buffer.set.types[e.buffer.buffer[r]],o}return s(t,e),d(t,[{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"child",value:function(e,n,r){var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new t(this.context,this,o)}},{key:"firstChild",get:function(){return this.child(1,0,4)}},{key:"lastChild",get:function(){return this.child(-1,0,4)}},{key:"childAfter",value:function(e){return this.child(1,e,2)}},{key:"childBefore",value:function(e){return this.child(-1,e,-2)}},{key:"enter",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(r&S.ExcludeBuffers)return null;var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new t(this.context,this,o)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"externalSibling",value:function(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}},{key:"nextSibling",get:function(){var e=this.context.buffer,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var e=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}},{key:"tree",get:function(){return null}},{key:"toTree",value:function(){var e=[],t=[],n=this.context.buffer,r=this.index+4,i=n.buffer[this.index+3];if(i>r){var o=n.buffer[this.index+1];e.push(n.slice(r,i,o)),t.push(0)}return new T(this.type,e,t,this.to-this.from)}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}}]),t}($);function F(e){if(!e.length)return null;for(var t=0,n=e[0],r=1;rn.from||i.to=t){var u=new Q(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(R(u,t,n,!1))}}return i?F(i):r}var z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(v(this,e),this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof Q)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}return d(e,[{key:"name",get:function(){return this.type.name}},{key:"yieldNode",value:function(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}},{key:"yieldBuf",value:function(e,t){this.index=e;var n=this.buffer,r=n.start,i=n.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}},{key:"yield",value:function(e){return!!e&&(e instanceof Q?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enterChild",value:function(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));var r=this.buffer.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}},{key:"firstChild",value:function(){return this.enterChild(1,0,4)}},{key:"lastChild",value:function(){return this.enterChild(-1,0,4)}},{key:"childAfter",value:function(e){return this.enterChild(1,e,2)}},{key:"childBefore",value:function(e){return this.enterChild(-1,e,-2)}},{key:"enter",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.mode;return this.buffer?!(n&S.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(this.mode&S.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var e=this.mode&S.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}},{key:"sibling",value:function(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));var t=this.buffer.buffer,n=this.stack.length-1;if(e<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{var i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(e){var t,n,r=this.buffer;if(r){if(e>0){if(this.index-1)for(var s=t+e,u=e<0?-1:n._tree.children.length;s!=u;s+=e){var c=n._tree.children[s];if(this.mode&S.IncludeAnonymous||c instanceof C||!c.type.isAnonymous||U(c))return!1}}return!0}},{key:"move",value:function(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}},{key:"next",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(1,e)}},{key:"prev",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(-1,e)}},{key:"moveTo",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(var o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break e}r=this.stack[--i]}for(var a=n;a=0;i--){if(i<0)return M(this._tree,e,r);var o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}]),e}();function U(e){return e.children.some((function(e){return e instanceof C||!e.type.isAnonymous||U(e)}))}function B(e){var t,n=e.buffer,r=e.nodeSet,i=e.maxBufferLength,o=void 0===i?g:i,a=e.reused,s=void 0===a?[]:a,u=e.minRepeatType,c=void 0===u?r.types.length:u,l=Array.isArray(n)?new j(n,n.length):n,f=r.types,h=0,p=0;function d(e,t,n,i,a,u){for(var g=l.id,w=l.start,x=l.end,k=l.size,S=p,_=h;k<0;){if(l.next(),-1==k){var P=s[g];return n.push(P),void i.push(w-e)}if(-3==k)return void(h=g);if(-4==k)return void(p=g);throw new RangeError("Unrecognized record size: ".concat(k))}var E,j,A=f[g],R=w-e;if(x-w<=o&&(j=function(e,t){var n=l.fork(),r=0,i=0,a=0,s=n.end-o,u={size:0,start:0,skip:0};e:for(var f=n.pos-e;n.pos>f;){var h=n.size;if(n.id==t&&h>=0)u.size=r,u.start=i,u.skip=a,a+=4,r+=4,n.next();else{var p=n.pos-h;if(h<0||p=c?4:0,m=n.start;for(n.next();n.pos>p;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=c&&(d+=4);n.next()}i=m,r+=h,a+=d}}(t<0||r==e)&&(u.size=r,u.start=i,u.skip=a);return u.size>4?u:void 0}(l.pos-t,a))){for(var $=new Uint16Array(j.size-j.skip),Q=l.pos-j.size,I=$.length;l.pos>Q;)I=b(j.start,$,I);E=new C($,x-j.start,r),R=j.start-e}else{var M=l.pos-k;l.next();for(var D=[],N=[],F=g>=c?g:-1,L=0,q=x;l.pos>M;)F>=0&&l.id==F&&l.size>=0?(l.end<=q-o&&(v(D,N,w,L,l.end,q,F,S,_),L=D.length,q=l.end),l.next()):u>2500?m(w,M,D,N):d(w,M,D,N,F,u+1);if(F>=0&&L>0&&L-1&&L>0){var z=function(e,t){return function(n,r,i){var o,a,s=0,u=n.length-1;if(u>=0&&(o=n[u])instanceof T){if(!u&&o.type==e&&o.length==i)return o;(a=o.prop(O.lookAhead))&&(s=r[u]+o.length+a)}return y(e,n,r,i,s,t)}}(A,_);E=W(A,D,N,0,D.length,0,x-w,z,z)}else E=y(A,D,N,x-w,S-x,_)}n.push(E),i.push(R)}function m(e,t,n,i){for(var a=[],s=0,u=-1;l.pos>t;){var c=l.id,f=l.start,h=l.end;if(l.size>4)l.next();else{if(u>-1&&f=0;m-=3)p[v++]=a[m],p[v++]=a[m+1]-d,p[v++]=a[m+2]-d,p[v++]=v;n.push(new C(p,a[2]-d,r)),i.push(d-e)}}function v(e,t,n,i,o,a,s,u,c){for(var l=[],f=[];e.length>i;)l.push(e.pop()),f.push(t.pop()+n-o);e.push(y(r.types[s],l,f,a-o,u-a,c)),t.push(o-n)}function y(e,t,n,r,i,o,a){if(o){var s=[O.contextHash,o];a=a?[s].concat(a):[s]}if(i>25){var u=[O.lookAhead,i];a=a?[u].concat(a):[u]}return new T(e,t,n,r,a)}function b(e,t,n){var r=l.id,i=l.start,o=l.end,a=l.size;if(l.next(),a>=0&&r4)for(var u=l.pos-(a-4);l.pos>u;)n=b(e,t,n);t[--n]=s,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==a?h=r:-4==a&&(p=r);return n}for(var w=[],x=[];l.pos>0;)d(e.start||0,e.bufferStart||0,w,x,-1,0);var k=null!==(t=e.length)&&void 0!==t?t:w.length?x[0]+w[0].length:0;return new T(f[e.topID],w.reverse(),x.reverse(),k)}var Z=new WeakMap;function V(e,t){if(!e.isAnonymous||t instanceof C||t.type!=e)return 1;var n=Z.get(t);if(null==n){n=1;var r,i=l(t.children);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.type!=e||!(o instanceof T)){n=1;break}n+=V(e,o)}}catch(e){i.e(e)}finally{i.f()}Z.set(t,n)}return n}function W(e,t,n,r,i,o,a,s,u){for(var c=0,l=r;l=f)break;m+=v}if(c==l+1){if(m>f){var g=n[l];t(g.children,g.positions,0,g.children.length,r[l]+s);continue}h.push(n[l])}else{var y=r[c-1]+n[c-1].length-d;h.push(W(e,n,r,l,c,d,y,null,u))}p.push(d+s-o)}}(t,n,r,i,0),(s||u)(h,p,a)}var X=function(){function e(){v(this,e),this.map=new WeakMap}return d(e,[{key:"setBuffer",value:function(e,t,n){var r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}},{key:"getBuffer",value:function(e,t){var n=this.map.get(e);return n&&n.get(t)}},{key:"set",value:function(e,t){e instanceof N?this.setBuffer(e.context.buffer,e.index,t):e instanceof Q&&this.map.set(e.tree,t)}},{key:"get",value:function(e){return e instanceof N?this.getBuffer(e.context.buffer,e.index):e instanceof Q?this.map.get(e.tree):void 0}},{key:"cursorSet",value:function(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}},{key:"cursorGet",value:function(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}]),e}(),Y=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];v(this,e),this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(a?2:0)}return d(e,[{key:"openStart",get:function(){return(1&this.open)>0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"addTree",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=[new e(0,t.length,t,0,!1,i)],a=l(r);try{for(a.s();!(n=a.n()).done;){var s=n.value;s.to>t.length&&o.push(s)}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"applyChanges",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return t;for(var i=[],o=1,a=t.length?t[0]:null,s=0,u=0,c=0;;s++){var l=s=r)for(;a&&a.from=h.from||f<=h.to||c){var p=Math.max(h.from,u)-c,d=Math.min(h.to,f)-c;h=p>=d?null:new e(p,d,h.tree,h.offset+c,s>0,!!l)}if(h&&i.push(h),a.to>f)break;a=o=e.to})))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}var te=d((function e(t,n,r,i,o,a,s){v(this,e),this.parser=t,this.predicate=n,this.mounts=r,this.index=i,this.start=o,this.target=a,this.prev=s,this.depth=0,this.ranges=[]})),ne=new O({perNode:!0}),re=function(){function e(t,n,r,i,o){v(this,e),this.nest=n,this.input=r,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}return d(e,[{key:"advance",value:function(){if(this.baseParse){var e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),null!=this.stoppedAt){var t,n=l(this.inner);try{for(n.s();!(t=n.n()).done;){t.value.parse.stopAt(this.stoppedAt)}}catch(e){n.e(e)}finally{n.f()}}}if(this.innerDone==this.inner.length){var r=this.baseTree;return null!=this.stoppedAt&&(r=new T(r.type,r.children,r.positions,r.length,r.propValues.concat([[ne,this.stoppedAt]]))),r}var i=this.inner[this.innerDone],o=i.parse.advance();if(o){this.innerDone++;var a=Object.assign(Object.create(null),i.target.props);a[O.mounted.id]=new w(o,i.overlay,i.parser),i.target.props=a}return null}},{key:"parsedPos",get:function(){if(this.baseParse)return 0;for(var e=this.input.length,t=this.innerDone;t=this.stoppedAt)a=!1;else if(e.hasNode(r)){if(t){var u=t.mounts.find((function(e){return e.frag.from<=r.from&&e.frag.to>=r.to&&e.mount.overlay}));if(u){var c,f=l(u.mount.overlay);try{var h=function(){var e=c.value,n=e.from+u.pos,i=e.to+u.pos;n>=r.from&&i<=r.to&&!t.ranges.some((function(e){return e.fromn}))&&t.ranges.push({from:n,to:i})};for(f.s();!(c=f.n()).done;)h()}catch(e){f.e(e)}finally{f.f()}}}a=!1}else if(n&&(o=ie(n.ranges,r.from,r.to)))a=2!=o;else if(!r.type.isAnonymous&&(i=this.nest(r,this.input))&&(r.from=0&&t.ranges[m].to==s.from?t.ranges[m]={from:t.ranges[m].from,to:s.to}:t.ranges.push(s)}if(a&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){var v=ce(this.ranges,t.ranges);v.length&&(ee(v),this.inner.splice(t.index,0,new J(t.parser,t.parser.startParse(this.input,le(t.mounts,v),v),t.ranges.map((function(e){return new b(e.from-t.start,e.to-t.start)})),t.target,v[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}]),e}();function ie(e,t,n){var r,i=l(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.from>=n)break;if(o.to>t)return o.from<=t&&o.to>=n?2:1}}catch(e){i.e(e)}finally{i.f()}return 0}function oe(e,t,n,r,i,o){if(t=e&&t.enter(n,1,S.IgnoreOverlays|S.ExcludeBuffers)||t.next(!1)||(this.done=!0)}},{key:"hasNode",value:function(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(var t=this.cursor.tree;;){if(t==e.tree)return!0;if(!(t.children.length&&0==t.positions[0]&&t.children[0]instanceof T))break;t=t.children[0]}return!1}}]),e}(),ue=function(){function e(t){var n;if(v(this,e),this.fragments=t,this.curTo=0,this.fragI=0,t.length){var r=this.curFrag=t[0];this.curTo=null!==(n=r.tree.prop(ne))&&void 0!==n?n:r.to,this.inner=new se(r.tree,-r.offset)}else this.curFrag=this.inner=null}return d(e,[{key:"hasNode",value:function(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}},{key:"nextFrag",value:function(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{var t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(ne))&&void 0!==e?e:t.to,this.inner=new se(t.tree,-t.offset)}}},{key:"findMounts",value:function(e,t){var n,r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(var i=this.inner.cursor.node;i;i=i.parent){var o=null===(n=i.tree)||void 0===n?void 0:n.prop(O.mounted);if(o&&o.parser==t)for(var a=this.fragI;a=i.to)break;s.tree==this.curFrag.tree&&r.push({frag:s,pos:i.from-s.offset,mount:o})}}}return r}}]),e}();function ce(e,t){for(var n=null,r=t,i=1,o=0;i=s)break;u.to<=a||(n||(r=n=t.slice()),u.froms&&n.splice(o+1,0,new b(s,u.to))):u.to>s?n[o--]=new b(s,u.to):n.splice(o--,1))}return r}function le(e,t){var n,r=[],i=l(e);try{var o=function(){var e=n.value,i=e.pos,o=e.mount,a=e.frag,s=i+(o.overlay?o.overlay[0].from:0),u=s+o.tree.length,c=Math.max(a.from,s),l=Math.min(a.to,u);if(o.overlay)for(var f=o.overlay.map((function(e){return new b(e.from+i,e.to+i)})),h=function(e,t,n,r){for(var i=0,o=0,a=!1,s=!1,u=-1e9,c=[];;){var l=i==e.length?1e9:a?e[i].to:e[i].from,f=o==t.length?1e9:s?t[o].to:t[o].from;if(a!=s){var h=Math.max(u,n),p=Math.min(l,f,r);hd&&r.push(new Y(d,v,o.tree,-s,a.from>=d||a.openStart,a.to<=v||a.openEnd)),m)break;d=h[p].to}else r.push(new Y(c,l,o.tree,-s,a.from>=s||a.openStart,a.to<=u||a.openEnd))};for(i.s();!(n=i.n()).done;)o()}catch(e){i.e(e)}finally{i.f()}return r}},3:function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t=0;--h)t.definitions[h].kind===o.a.OPERATION_DEFINITION&&++f;var v=d(e),g=function(e){return Object(l.b)(e)&&e.map(v).some((function(e){return e&&e.remove}))},y=new Map,b=!1,O={enter:function(e){if(g(e.directives))return b=!0,null}},w=Object(a.b)(t,{Field:O,InlineFragment:O,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,i){var o=c(i);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,i){if(g(e.directives))return b=!0,null;var o=c(i);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){y.set(JSON.stringify(r),e)},leave:function(e,t,n,r){return e===y.get(JSON.stringify(r))?e:f>0&&e.selectionSet.selections.every((function(e){return e.kind===o.a.FIELD&&"__typename"===e.name.value}))?(u(e.name.value).removed=!0,b=!0,null):void 0}},Directive:{leave:function(e){if(v(e))return b=!0,null}}});if(!b)return t;var x=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){x(u(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},k=new Set;w.definitions.forEach((function(e){e.kind===o.a.OPERATION_DEFINITION?x(n(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){k.add(e)})):e.kind!==o.a.FRAGMENT_DEFINITION||0!==f||u(e.name.value).removed||k.add(e.name.value)})),k.forEach((function(e){x(u(e)).fragmentSpreads.forEach((function(e){k.add(e)}))}));var S={enter:function(e){if(t=e.name.value,!k.has(t)||u(t).removed)return null;var t}};return p(Object(a.b)(w,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=x(n(e.name&&e.name.value)).transitiveVars;if(t.size0}},356:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));const r=()=>Object.create(null),{forEach:i,slice:o}=Array.prototype,{hasOwnProperty:a}=Object.prototype;class s{constructor(e=!0,t=r){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return i.call(e,(e=>t=t.getChildTrie(e))),a.call(t,"data")?t.data:t.data=this.makeData(o.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n1&&o===a&&(o="");var s=e.pageInfo||{},u=s.startCursor,c=s.endCursor;return Object(m.__assign)(Object(m.__assign)({},O(e)),{edges:i,pageInfo:Object(m.__assign)(Object(m.__assign)({},e.pageInfo),{startCursor:u||o,endCursor:c||a})})},merge:function(e,t,n){var r=n.args,i=n.isReference,o=n.readField;if(e||(e={edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}),!t)return e;var a=t.edges?t.edges.map((function(e){return i(e=Object(m.__assign)({},e))&&(e.cursor=o("cursor",e)),e})):[];if(t.pageInfo){var s=t.pageInfo,u=s.startCursor,c=s.endCursor,l=a[0],f=a[a.length-1];l&&u&&(l.cursor=u),f&&c&&(f.cursor=c);var h=l&&l.cursor;h&&!u&&(t=Object(v.b)(t,{pageInfo:{startCursor:h}}));var p=f&&f.cursor;p&&!c&&(t=Object(v.b)(t,{pageInfo:{endCursor:p}}))}var d=e.edges,g=[];if(r&&r.after)(y=d.findIndex((function(e){return e.cursor===r.after})))>=0&&(d=d.slice(0,y+1));else if(r&&r.before){var y;g=(y=d.findIndex((function(e){return e.cursor===r.before})))<0?d:d.slice(y),d=[]}else t.edges&&(d=[]);var b=Object(m.__spreadArray)(Object(m.__spreadArray)(Object(m.__spreadArray)([],d,!0),a,!0),g,!0),w=Object(m.__assign)(Object(m.__assign)({},t.pageInfo),e.pageInfo);if(t.pageInfo){var x=t.pageInfo,k=x.hasPreviousPage,S=x.hasNextPage,_=(u=x.startCursor,c=x.endCursor,Object(m.__rest)(x,["hasPreviousPage","hasNextPage","startCursor","endCursor"]));Object.assign(w,_),d.length||(void 0!==k&&(w.hasPreviousPage=k),void 0!==u&&(w.startCursor=u)),g.length||(void 0!==S&&(w.hasNextPage=S),void 0!==c&&(w.endCursor=c))}return Object(m.__assign)(Object(m.__assign)(Object(m.__assign)({},O(e)),O(t)),{edges:b,pageInfo:w})}}}var O=function(e){return Object(m.__rest)(e,w)},w=["edges","pageInfo"];var x=n(571);function k(e){var t=Promise.resolve(e);return t.status="fulfilled",t.value=e,t}function S(e){var t=Promise.reject(e);return t.catch((function(){})),t.status="rejected",t.reason=e,t}function _(e){return"status"in e}function P(e){if(_(e))return e;var t=e;return t.status="pending",t.then((function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}}),(function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})),e}var E=n(839),T=n(871),j=n(577),C=n(875),A=n(876),R=n(786),$=n(354),Q=n(151),I=n(877),M=n(393),D=n(616),N=n(784),F=n(576),L=n(837),q=n(489),z=n(785);function U(e,t){return B(e,t)}function B(e,t,n){if(void 0===n&&(n=new Map),n.has(e))return n.get(e);var r=!1;if(Array.isArray(e)){var i=[];if(n.set(e,i),e.forEach((function(e,o){var a=B(e,t,n);r||(r=a!==e),i[o]=a})),r)return i}else if(Object(Q.b)(e)){var o=Object.create(Object.getPrototypeOf(e));if(n.set(e,o),Object.keys(e).forEach((function(i){if(i!==t){var a=B(e[i],t,n);r||(r=a!==e[i]),o[i]=a}else r=!0})),r)return o}return e}function Z(e){return U(e,"__typename")}var V=n(861),W=n(588)},388:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(10),i=n(18);function o(e,t){var n=t,o=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw Object(i.e)(74,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&o.push(e)})),void 0===n&&(Object(i.c)(1===o.length,75,o.length),n=o[0].name.value),Object(r.__assign)(Object(r.__assign)({},e),{definitions:Object(r.__spreadArray)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function a(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function s(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=e.name.value;if("function"==typeof t)return t(n);var r=t&&t[n];return Object(i.c)(r,76,n),r||null;default:return null}}},389:function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t=0}))||!1,f=(c||i)&&!l}).call(this,n(239))},396:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));const r="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),i="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class a{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,o,a){let s=[],u=/^@(\w+)\b/.exec(e[0]),c=u&&"keyframes"==u[1];if(u&&null==t)return o.push(e[0]+";");for(let n in t){let a=t[n];if(/&/.test(n))i(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),a,o);else if(a&&"object"==typeof a){if(!u)throw new RangeError("The value of a property ("+n+") should be a primitive value.");i(r(n),a,s,c)}else null!=a&&s.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+a+";")}(s.length||c)&&o.push((!n||u||a?e:e.map(n)).join(", ")+" {"+s.join(" ")+"}")}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=o[r]||1;return o[r]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[i],o=n&&n.nonce;r?o&&r.setNonce(o):r=new u(e,o),r.mount(Array.isArray(t)?t:[t],e)}}let s=new Map;class u{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=s.get(n);if(t)return e[i]=t;this.sheet=new r.CSSStyleSheet,s.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[i]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t-1&&(this.modules.splice(a,1),i--,a=-1),-1==a){if(this.modules.splice(i++,0,o),n)for(let e=0;e0?new u.a({graphQLErrors:o}):void 0,h=e.onError||(null===(n=d.current.options)||void 0===n?void 0:n.onError);if(s&&h&&h(s,f),l===d.current.mutationId&&!f.ignoreResults){var m={called:!0,loading:!1,data:i,error:s,client:c};d.current.isMounted&&!Object(a.b)(d.current.result,m)&&p(d.current.result=m)}var v=e.onCompleted||(null===(r=d.current.options)||void 0===r?void 0:r.onCompleted);return s||null==v||v(t.data,f),t})).catch((function(t){var n;if(l===d.current.mutationId&&d.current.isMounted){var r={loading:!1,error:t,data:void 0,called:!0,client:c};Object(a.b)(d.current.result,r)||p(d.current.result=r)}var i=e.onError||(null===(n=d.current.options)||void 0===n?void 0:n.onError);if(i)return i(t,f),{data:void 0,errors:t};throw t}))}),[]),v=i.useCallback((function(){if(d.current.isMounted){var e={called:!1,loading:!1,client:d.current.client};Object.assign(d.current,{mutationId:0,result:e}),p(e)}}),[]);return i.useEffect((function(){var e=d.current;return e.isMounted=!0,function(){e.isMounted=!1}}),[]),[m,Object(r.__assign)({reset:v},h)]}},409:function(e,t,n){"use strict";n.r(t),n.d(t,"empty",(function(){return i})),n.d(t,"from",(function(){return o})),n.d(t,"split",(function(){return a})),n.d(t,"concat",(function(){return s})),n.d(t,"execute",(function(){return u.a})),n.d(t,"ApolloLink",(function(){return r.a}));n(18);var r=n(166),i=r.a.empty,o=r.a.from,a=r.a.split,s=r.a.concat,u=n(878)},411:function(e,t,n){"use strict";n.d(t,"g",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return f}));var r=n(18),i=n(243);function o(e,t){var n=e.directives;return!n||!n.length||f(n).every((function(e){var n=e.directive,i=e.ifArgument,o=!1;return"Variable"===i.value.kind?(o=t&&t[i.value.name.value],Object(r.c)(void 0!==o,70,n.name.value)):o=i.value.value,"skip"===n.name.value?!o:o}))}function a(e){var t=[];return Object(i.b)(e,{Directive:function(e){t.push(e.name.value)}}),t}var s=function(e,t){return c(e,t,!1)},u=function(e,t){return c(e,t,!0)};function c(e,t,n){var r=new Set(e),o=r.size;return Object(i.b)(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return i.a}}),n?!r.size:r.size=0&&e.indexOf(t,n)===n}(n,f)}}return!1}function c(e){return Object.keys(e).filter(l,e)}function l(e){return void 0!==this[e]}t.a=s;const f="{ [native code] }";function h(e,t){let n=a.get(e);if(n){if(n.has(t))return!0}else a.set(e,n=new Set);return n.add(t),!1}},43:function(e,t,n){"use strict";n.d(t,"a",(function(){return Si})),n.d(t,"b",(function(){return uo})),n.d(t,"c",(function(){return Qi})),n.d(t,"d",(function(){return So}));var r=n(11),i=n(7),o=n(205),a=n(156),s=n(46),u=n(9),c=n(137);function l(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t,n){return t=y(t),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,v()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function d(e){var t="function"==typeof Map?new Map:void 0;return d=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return m(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)},d(e)}function m(e,t,n){if(v())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&g(i,n.prototype),i}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n47&&e<58}function N(e,t,n){return n=n||90,(e&=-33)>=(t=t||65)&&e<=n}function F(e){return D(e)||L(e)}function L(e){return 95===e||N(e)}function q(e){return function(e){return 32===e||9===e||160===e}(e)||10===e||13===e}function z(e){return 39===e||34===e}var U,B,Z=function(){function e(t,n,r){b(this,e),null==r&&"string"==typeof t&&(r=t.length),this.string=t,this.pos=this.start=n||0,this.end=r||0}return w(e,[{key:"eof",value:function(){return this.pos>=this.end}},{key:"limit",value:function(t,n){return new e(this.string,t,n)}},{key:"peek",value:function(){return this.string.charCodeAt(this.pos)}},{key:"next",value:function(){if(this.pos1&&void 0!==arguments[1]?arguments[1]:this.pos;return new V("".concat(e," at ").concat(t+1),t,this.string)}}]),e}(),V=function(e){function t(e,n,r){var i;return b(this,t),(i=h(this,t,[e])).pos=n,i.string=r,i}return p(t,e),w(t)}(d(Error));function W(e){return{tokens:e,start:0,pos:0,size:e.length}}function X(e){return e.tokens[e.pos]}function Y(e){return e.tokens[e.pos++]}function G(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.pos;return e.tokens.slice(t,n)}function H(e){return e.pos2&&void 0!==arguments[2]?arguments[2]:X(e);n&&null!=n.start&&(t+=" at ".concat(n.start));var r=new Error(t);return r.pos=n&&n.start,r}function ee(e,t){for(var n,r={type:"TokenGroup",elements:[]},i=r,o=[];H(e)&&(n=ne(e,t)||te(e,t));)if(i.elements.push(n),K(e,Se))o.push(i),i=n;else{if(K(e,_e))continue;if(K(e,Pe))do{o.length&&(i=o.pop())}while(K(e,Pe))}return r}function te(e,t){if(K(e,xe)){var n=ee(e,t);return le(Y(e),"group",!1)&&(n.repeat=function(e){return me(X(e))?e.tokens[e.pos++]:void 0}(e)),n}}function ne(e,t){var n,r={type:"TokenElement",name:void 0,attributes:void 0,value:void 0,repeat:void 0,selfClose:!1,elements:[]};for(function(e,t){var n=e.pos;if(t.jsx&&K(e,ve))for(;H(e);){var r=e.pos;if(!K(e,ye)||!K(e,ve)){e.pos=r;break}}for(;H(e)&&K(e,ge););if(e.pos!==n)return e.start=n,!0;return!1}(e,t)&&(r.name=G(e));H(e);)if(e.start=e.pos,r.repeat||ke(r)||!K(e,me))if(!r.value&&ue(e))r.value=ce(e);else{if(!(n=ie(e,"id",t)||ie(e,"class",t)||re(e))){!ke(r)&&K(e,Ee)&&(r.selfClose=!0,!r.repeat&&K(e,me)&&(r.repeat=e.tokens[e.pos-1]));break}r.attributes?r.attributes=r.attributes.concat(n):r.attributes=Array.isArray(n)?n.slice():[n]}else r.repeat=e.tokens[e.pos-1];return ke(r)?void 0:r}function re(e){if(K(e,be)){for(var t,n=[];H(e);)if(t=oe(e))n.push(t);else{if(K(e,Oe))break;if(!K(e,pe))throw J(e,'Unexpected "'.concat(X(e).type,'" token'))}return n}}function ie(e,t,n){if(fe(X(e),t)){e.pos++;for(var r=1;fe(X(e),t);)e.pos++,r++;var i={name:[(o=t,{type:"Literal",value:o})]};return r>1&&(i.multiple=!0),n.jsx&&ue(e)?(i.value=ce(e),i.expression=!0):i.value=se(e)?G(e):void 0,i}var o}function oe(e){if(ae(e))return{value:G(e)};if(se(e,!0)){var t,n=G(e);return K(e,de)&&(ae(e)||se(e,!0))&&(t=G(e)),{name:n,value:t}}}function ae(e){var t=e.pos,n=X(e);if(he(n)){for(e.pos++;H(e);)if(he(Y(e),n.single))return e.start=t,!0;throw J(e,"Unclosed quote",n)}return!1}function se(e,t){for(var n=e.pos,r={attribute:0,expression:0,group:0};H(e);){var i=X(e);if(r.expression)le(i,"expression")&&(r[i.context]+=i.open?1:-1);else{if(he(i)||fe(i)||pe(i)||me(i))break;if(le(i)){if(!t)break;if(i.open)r[i.context]++;else{if(!r[i.context])break;r[i.context]--}}}e.pos++}return n!==e.pos&&(e.start=n,!0)}function ue(e){var t=e.pos;if(K(e,we)){for(var n=0;H(e);){var r=Y(e);if(le(r,"expression"))if(r.open)n++;else{if(!n)break;n--}}return e.start=t,!0}return!1}function ce(e){var t=e.start,n=e.pos;return le(e.tokens[t],"expression",!0)&&t++,le(e.tokens[n-1],"expression",!1)&&n--,G(e,t,n)}function le(e,t,n){return Boolean(e&&"Bracket"===e.type&&(!t||e.context===t)&&(null==n||e.open===n))}function fe(e,t){return Boolean(e&&"Operator"===e.type&&(!t||e.operator===t))}function he(e,t){return Boolean(e&&"Quote"===e.type&&(null==t||e.single===t))}function pe(e){return Boolean(e&&"WhiteSpace"===e.type)}function de(e){return fe(e,"equal")}function me(e){return Boolean(e&&"Repeater"===e.type)}function ve(e){if(function(e){return"Literal"===e.type}(e)){var t=e.value.charCodeAt(0);return t>=65&&t<=90}return!1}function ge(e){return"Literal"===e.type||"RepeaterNumber"===e.type||"RepeaterPlaceholder"===e.type}function ye(e){return fe(e,"class")}function be(e){return le(e,"attribute",!0)}function Oe(e){return le(e,"attribute",!1)}function we(e){return le(e,"expression",!0)}function xe(e){return le(e,"group",!0)}function ke(e){return!e.name&&!e.value&&!e.attributes}function Se(e){return fe(e,"child")}function _e(e){return fe(e,"sibling")}function Pe(e){return fe(e,"climb")}function Ee(e){return fe(e,"close")}function Te(e){return!!e.eat(U.Escape)&&(e.start=e.pos,e.eof()||e.pos++,!0)}function je(e,t){return function(e,t){var n=e.pos;if((t.expression||t.attribute)&&e.eat(U.Dollar)&&e.eat(U.CurlyBracketOpen)){var r;e.start=e.pos;var i="";if(e.eatWhile(D)?(r=Number(e.current()),i=e.eat(U.Colon)?Ce(e):""):N(e.peek())&&(i=Ce(e)),e.eat(U.CurlyBracketClose))return{type:"Field",index:r,name:i,start:n,end:e.pos};throw e.error("Expecting }")}e.pos=n}(e,t)||function(e){var t=e.pos;if(e.eat(U.Dollar)&&e.eat(U.Hash))return{type:"RepeaterPlaceholder",value:void 0,start:t,end:e.pos};e.pos=t}(e)||function(e){var t=e.pos;if(e.eatWhile(U.Dollar)){var n=e.pos-t,r=!1,i=1,o=0;if(e.eat(U.At)){for(;e.eat(U.Climb);)o++;r=e.eat(U.Dash),e.start=e.pos,e.eatWhile(D)&&(i=Number(e.current()))}return e.start=t,{type:"RepeaterNumber",size:n,reverse:r,base:i,parent:o,start:t,end:e.pos}}}(e)||function(e){var t=e.pos;if(e.eat(U.Asterisk)){e.start=e.pos;var n=1,r=!1;return e.eatWhile(D)?n=Number(e.current()):r=!0,{type:"Repeater",count:n,value:0,implicit:r,start:t,end:e.pos}}}(e)||function(e){var t=e.pos;if(e.eatWhile(q))return{type:"WhiteSpace",start:t,end:e.pos,value:e.substring(t,e.pos)}}(e)||function(e,t){var n=e.pos,r=t.expression,i="";for(;!e.eof();)if(Te(e))i+=e.current();else{var o=e.peek();if(o===U.Slash&&!t.quote&&!t.expression&&!t.attribute){var a=e.string.charCodeAt(e.pos-1),s=e.string.charCodeAt(e.pos+1);if(D(a)&&D(s)){i+=e.string[e.pos++];continue}}if(o===t.quote||o===U.Dollar||Ae(o,t))break;if(r){if(o===U.CurlyBracketOpen)t.expression++;else if(o===U.CurlyBracketClose){if(!(t.expression>r))break;t.expression--}}else if(!t.quote){if(!t.attribute&&!De(o))break;if(Re(o,t)||$e(o,t)||z(o)||Qe(o))break}i+=e.string[e.pos++]}if(n!==e.pos)return e.start=n,{type:"Literal",value:i,start:n,end:e.pos}}(e,t)||function(e){var t=Ie(e.peek());if(t)return{type:"Operator",operator:t,start:e.pos++,end:e.pos}}(e)||function(e){var t=e.peek();if(z(t))return{type:"Quote",single:t===U.SingleQuote,start:e.pos++,end:e.pos}}(e)||function(e){var t=e.peek(),n=Qe(t);if(n)return{type:"Bracket",open:Me(t),context:n,start:e.pos++,end:e.pos}}(e)}function Ce(e){var t=[];for(e.start=e.pos;!e.eof();)if(e.eat(U.CurlyBracketOpen))t.push(e.pos);else if(e.eat(U.CurlyBracketClose)){if(!t.length){e.pos--;break}t.pop()}else e.pos++;if(t.length)throw e.pos=t.pop(),e.error("Expecting }");return e.current()}function Ae(e,t){var n=Ie(e);return!(!n||t.quote||t.expression)&&(!t.attribute||"equal"===n)}function Re(e,t){return q(e)&&!t.expression}function $e(e,t){return e===U.Asterisk&&!t.attribute&&!t.expression}function Qe(e){return e===U.RoundBracketOpen||e===U.RoundBracketClose?"group":e===U.SquareBracketOpen||e===U.SquareBracketClose?"attribute":e===U.CurlyBracketOpen||e===U.CurlyBracketClose?"expression":void 0}function Ie(e){return(e===U.Child?"child":e===U.Sibling&&"sibling")||e===U.Climb&&"climb"||e===U.Dot&&"class"||e===U.Hash&&"id"||e===U.Slash&&"close"||e===U.Equals&&"equal"||void 0}function Me(e){return e===U.CurlyBracketOpen||e===U.SquareBracketOpen||e===U.RoundBracketOpen}function De(e){return F(e)||(196===(t=e)||214==t||220===t||228===t||246===t||252===t)||e===U.Dash||e===U.Colon||e===U.Excl;var t}(B=U||(U={}))[B.CurlyBracketOpen=123]="CurlyBracketOpen",B[B.CurlyBracketClose=125]="CurlyBracketClose",B[B.Escape=92]="Escape",B[B.Equals=61]="Equals",B[B.SquareBracketOpen=91]="SquareBracketOpen",B[B.SquareBracketClose=93]="SquareBracketClose",B[B.Asterisk=42]="Asterisk",B[B.Hash=35]="Hash",B[B.Dollar=36]="Dollar",B[B.Dash=45]="Dash",B[B.Dot=46]="Dot",B[B.Slash=47]="Slash",B[B.Colon=58]="Colon",B[B.Excl=33]="Excl",B[B.At=64]="At",B[B.Underscore=95]="Underscore",B[B.RoundBracketOpen=40]="RoundBracketOpen",B[B.RoundBracketClose=41]="RoundBracketClose",B[B.Sibling=43]="Sibling",B[B.Child=62]="Child",B[B.Climb=94]="Climb",B[B.SingleQuote=39]="SingleQuote",B[B.DoubleQuote=34]="DoubleQuote";var Ne={child:">",class:".",climb:"^",id:"#",equal:"=",close:"/",sibling:"+"},Fe={Literal:function(e){return e.value},Quote:function(e){return e.single?"'":'"'},Bracket:function(e){return"attribute"===e.context?e.open?"[":"]":"expression"===e.context?e.open?"{":"}":e.open?"(":"}"},Operator:function(e){return Ne[e.operator]},Field:function(e,t){return null!=e.index?e.name?"${".concat(e.index,":").concat(e.name,"}"):"${".concat(e.index):e.name?t.getVariable(e.name):""},RepeaterPlaceholder:function(e,t){for(var n,r=t.repeaters.length-1;r>=0;r--)if(t.repeaters[r].implicit){n=t.repeaters[r];break}return t.inserted=!0,t.getText(n&&n.value)},RepeaterNumber:function(e,t){var n=1,r=t.repeaters.length-1,i=t.repeaters[r];if(i&&(n=e.reverse?e.base+i.count-i.value-1:e.base+i.value,e.parent)){var o=Math.max(0,r-e.parent);if(o!==r){var a=t.repeaters[o];n+=i.count*a.value}}for(var s=String(n);s.length1&&void 0!==arguments[1]?arguments[1]:{},r=!1;n.text&&(t=Array.isArray(n.text)?n.text.filter((function(e){return e.trim()})):n.text);var i={type:"Abbreviation",children:Xe(e,{inserted:!1,repeaters:[],text:n.text,cleanText:t,repeatGuard:n.maxRepeat||Number.POSITIVE_INFINITY,getText:function(e){var i,o;if(r=!0,Array.isArray(n.text)){if(void 0!==e&&e>=0&&e1&&void 0!==arguments[1]?arguments[1]:{},n=W(e),r=ee(n,t);if(H(n))throw J(n,"Unexpected character");return r}("string"==typeof e?function(e){for(var t,n=new Z(e),r=[],i={group:0,attribute:0,expression:0,quote:0},o=0;!n.eof();){if(o=n.peek(),!(t=je(n,i)))throw n.error("Unexpected character");r.push(t),"Quote"===t.type?i.quote=o===i.quote?0:o:"Bracket"===t.type&&(i[t.context]+=t.open?1:-1)}return r}(e):e,t),t)}catch(t){throw t instanceof V&&"string"==typeof e&&(t.message+="\n".concat(e,"\n").concat("-".repeat(t.pos),"^")),t}}function ot(e,t){return function(e){var t=e.pos;if(e.eat(Ue.Dollar)&&e.eat(Ue.CurlyBracketOpen)){var n;e.start=e.pos;var r="";if(e.eatWhile(D)?(n=Number(e.current()),r=e.eat(Ue.Colon)?at(e):""):N(e.peek())&&(r=at(e)),e.eat(Ue.CurlyBracketClose))return{type:"Field",index:n,name:r,start:t,end:e.pos};throw e.error("Expecting }")}e.pos=t}(e)||function(e){var t=e.pos;if(e.eat(Ue.Dash)&&e.eat(Ue.Dash))return e.start=t,e.eatWhile(ht),{type:"CustomProperty",value:e.current(),start:t,end:e.pos};e.pos=t}(e)||function(e){var t=e.pos;if(function(e){var t=e.pos;e.eat(Ue.Dash);var n=e.pos,r=e.eatWhile(D),i=e.pos;if(e.eat(Ue.Dot)){var o=e.eatWhile(D);r||o||(e.pos=i)}e.pos===n&&(e.pos=t);return e.pos!==t}(e)){e.start=t;var n=e.current();return e.start=e.pos,e.eat(Ue.Percent)||e.eatWhile(L),{type:"NumberValue",value:Number(n),rawValue:n,unit:e.current(),start:t,end:e.pos}}}(e)||function(e){var t=e.pos;if(e.eat(Ue.Hash)){var n=e.pos,r="",i="";if(e.eatWhile(ft)?(r=e.substring(n,e.pos),i=ut(e)):e.eat(Ue.Transparent)?(r="0",i=ut(e)||"0"):i=ut(e),r||i||e.eof()){var o=function(e,t){var n="0",r="0",i="0",o=Number(null!=t&&""!==t?t:1);if("t"===e)o=0;else switch(e.length){case 0:break;case 1:n=r=i=e+e;break;case 2:n=r=i=e;break;case 3:n=e[0]+e[0],r=e[1]+e[1],i=e[2]+e[2];break;default:n=(e+=e).slice(0,2),r=e.slice(2,4),i=e.slice(4,6)}return{r:parseInt(n,16),g:parseInt(r,16),b:parseInt(i,16),a:o}}(r,i);return{type:"ColorValue",r:o.r,g:o.g,b:o.b,a:o.a,raw:e.substring(t+1,e.pos),start:t,end:e.pos}}return st(e,t)}e.pos=t}(e)||function(e){var t=e.peek(),n=e.pos,r=!1;if(z(t)){for(e.pos++;!e.eof();){if(e.eat(t)){r=!0;break}e.pos++}return e.start=n,{type:"StringValue",value:e.substring(n+1,e.pos-(r?1:0)),quote:t===Ue.SingleQuote?"single":"double",start:n,end:e.pos}}}(e)||function(e){var t=e.peek();if(n=t,n===Ue.RoundBracketOpen||n===Ue.RoundBracketClose)return{type:"Bracket",open:t===Ue.RoundBracketOpen,start:e.pos++,end:e.pos};var n}(e)||ct(e)||function(e){var t=e.pos;if(e.eatWhile(q))return{type:"WhiteSpace",start:t,end:e.pos}}(e)||function(e,t){var n=e.pos;e.eat(lt)?e.eatWhile(n?ht:pt):e.eat(L)?e.eatWhile(t?pt:ht):(e.eat(Ue.Dot),e.eatWhile(pt));if(n!==e.pos)return e.start=n,st(e,e.start=n)}(e,t)}function at(e){var t=[];for(e.start=e.pos;!e.eof();)if(e.eat(Ue.CurlyBracketOpen))t.push(e.pos);else if(e.eat(Ue.CurlyBracketClose)){if(!t.length){e.pos--;break}t.pop()}else e.pos++;if(t.length)throw e.pos=t.pop(),e.error("Expecting }");return e.current()}function st(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.pos;return{type:"Literal",value:e.substring(t,n),start:t,end:n}}function ut(e){var t=e.pos;return e.eat(Ue.Dot)?(e.start=t,e.eatWhile(D)?e.current():"1"):""}function ct(e){var t,n=(t=e.peek())===Ue.Sibling&&qe.Sibling||t===Ue.Excl&&qe.Important||t===Ue.Comma&&qe.ArgumentDelimiter||t===Ue.Colon&&qe.PropertyDelimiter||t===Ue.Dash&&qe.ValueDelimiter||void 0;if(n)return{type:"Operator",operator:n,start:e.pos++,end:e.pos}}function lt(e){return e===Ue.At||e===Ue.Dollar}function ft(e){return D(e)||N(e,65,70)}function ht(e){return F(e)||e===Ue.Dash}function pt(e){return L(e)||e===Ue.Percent||e===Ue.Slash}function dt(e){return"ColorValue"===e.type||"NumberValue"===e.type&&!e.unit}function mt(e,t){for(var n,r=0,i=0;t.length;){var o=(n=t)[n.length-1];if("Literal"!==o.type&&"NumberValue"!==o.type)break;r=o.start,i||(i=o.end),t.pop()}r!==i&&t.push(st(e,r,i))}function vt(e){return{tokens:e,start:0,pos:0,size:e.length}}function gt(e){return e.tokens[e.pos]}function yt(e){return e.pos2&&void 0!==arguments[2]?arguments[2]:gt(e);n&&null!=n.start&&(t+=" at ".concat(n.start));var r=new Error(t);return r.pos=n&&n.start,r}function wt(e,t){var n,r,i=!1,o=[],a=gt(e),s=!!t.value;for(s||!St(a)||function(e){var t=e.tokens[e.pos],n=e.tokens[e.pos+1];return t&&n&&St(t)&&"Bracket"===n.type}(e)||(e.pos++,n=a.value,bt(e,It)),s&&bt(e,Tt);yt(e);)if(bt(e,$t))i=!0;else if(r=xt(e,s))o.push(r);else if(!bt(e,Rt))break;if(n||o.length||i)return{name:n,value:o,important:i}}function xt(e,t){for(var n,r,i=[];yt(e);)if(Qt(n=gt(e)))e.pos++,St(n)&&(r=kt(e))?i.push({type:"FunctionCall",name:n.value,arguments:r}):i.push(n);else{if(!(It(n)||t&&Tt(n)))break;e.pos++}return i.length?{type:"CSSValue",value:i}:void 0}function kt(e){var t=e.pos;if(bt(e,Pt)){for(var n,r=[];yt(e)&&!bt(e,Et);)if(n=xt(e,!0))r.push(n);else if(!bt(e,Tt)&&!bt(e,At))throw Ot(e,"Unexpected token");return e.start=t,r}}function St(e){return e&&"Literal"===e.type}function _t(e,t){return e&&"Bracket"===e.type&&(null==t||e.open===t)}function Pt(e){return _t(e,!0)}function Et(e){return _t(e,!1)}function Tt(e){return e&&"WhiteSpace"===e.type}function jt(e,t){return e&&"Operator"===e.type&&(!t||e.operator===t)}function Ct(e){return jt(e,qe.Sibling)}function At(e){return jt(e,qe.ArgumentDelimiter)}function Rt(e){return At(e)}function $t(e){return jt(e,qe.Important)}function Qt(e){return"StringValue"===e.type||"ColorValue"===e.type||"NumberValue"===e.type||"Literal"===e.type||"Field"===e.type||"CustomProperty"===e.type}function It(e){return jt(e,qe.PropertyDelimiter)||jt(e,qe.ValueDelimiter)}function Mt(e,t){try{return function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=vt(e),i=[];yt(r);)if(t=wt(r,n))i.push(t);else if(!bt(r,Ct))throw Ot(r,"Unexpected token");return i}("string"==typeof e?function(e,t){for(var n,r=0,i=new Z(e),o=[];!i.eof();){if(!(n=ot(i,0===r&&!t)))throw i.error("Unexpected character");if("Bracket"===n.type&&(!r&&n.open&&mt(i,o),(r+=n.open?1:-1)<0))throw i.error("Unexpected bracket",n.start);o.push(n),dt(n)&&(n=ct(i))&&o.push(n)}return o}(e,t&&t.value):e,t)}catch(t){throw t instanceof V&&"string"==typeof e&&(t.message+="\n".concat(e,"\n").concat("-".repeat(t.pos),"^")),t}}function Dt(e,t,n){if(e&&t){e.length&&n&&Ft(e,n);var r,i=S(t);try{for(i.s();!(r=i.n()).done;){Ft(e,r.value)}}catch(e){i.e(e)}finally{i.f()}return e}var o=e||t;return o&&o.slice()}function Nt(e,t,n){return e.name=t.name,n.options["output.reverseAttributes"]||(e.value=t.value),e.implied||(e.implied=t.implied),e.boolean||(e.boolean=t.boolean),"expression"!==e.valueType&&(e.valueType=t.valueType),e}function Ft(e,t){var n=e.length-1;"string"==typeof e[n]&&"string"==typeof t?e[n]+=t:e.push(t)}function Lt(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return{options:e,value:"",level:t,offset:0,line:0,column:0}}function Vt(e,t){en(e,(0,e.options["output.text"])(t,e.offset,e.line,e.column))}function Wt(e,t){for(var n=t.split(/\r\n|\r|\n/g),r=0,i=n.length-1;r<=i;r++)Vt(e,n[r]),r!==i&&Xt(e,!0)}function Xt(e,t){var n=e.options["output.baseIndent"];Vt(e,e.options["output.newline"]+n),e.line++,e.column=n.length,t&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.level,n=e.options["output.indent"];Vt(e,n.repeat(Math.max(t,0)))}(e,!0===t?e.level:t)}function Yt(e,t,n){en(e,(0,e.options["output.field"])(t,n,e.offset,e.line,e.column))}function Gt(e,t){return tn(e,t.options["output.attributeCase"])}function Ht(e,t,n){return"expression"===e.valueType?n?"{":"}":"single"===t.options["output.attributeQuotes"]?"'":'"'}function Kt(e,t){return e.boolean||t.options["output.booleanAttributes"].includes((e.name||"").toLowerCase())}function Jt(e,t){return"string"==typeof e?t.options.inlineElements.includes(e.toLowerCase()):e.name?Jt(e.name,t):Boolean(e.value&&!e.attributes)}function en(e,t){e.value+=t,e.offset+=t.length,e.column+=t.length}function tn(e,t){return t?"upper"===t?e.toUpperCase():e.toLowerCase():e}var nn={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};function rn(e,t,n){var r=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t];if(zt(n))return n}}(t),i=n.context?n.context.name:"",o=((r?r.name:i)||"").toLowerCase();e.name=nn[o]||(Jt(o,n)?"span":"div")}var on={ru:{common:["далеко-далеко","за","словесными","горами","в стране","гласных","и согласных","живут","рыбные","тексты"],words:["вдали","от всех","они","буквенных","домах","на берегу","семантика","большого","языкового","океана","маленький","ручеек","даль","журчит","по всей","обеспечивает","ее","всеми","необходимыми","правилами","эта","парадигматическая","страна","которой","жаренные","предложения","залетают","прямо","рот","даже","всемогущая","пунктуация","не","имеет","власти","над","рыбными","текстами","ведущими","безорфографичный","образ","жизни","однажды","одна","маленькая","строчка","рыбного","текста","имени","lorem","ipsum","решила","выйти","большой","мир","грамматики","великий","оксмокс","предупреждал","о","злых","запятых","диких","знаках","вопроса","коварных","точках","запятой","но","текст","дал","сбить","себя","толку","он","собрал","семь","своих","заглавных","букв","подпоясал","инициал","за","пояс","пустился","дорогу","взобравшись","первую","вершину","курсивных","гор","бросил","последний","взгляд","назад","силуэт","своего","родного","города","буквоград","заголовок","деревни","алфавит","подзаголовок","своего","переулка","грустный","реторический","вопрос","скатился","его","щеке","продолжил","свой","путь","дороге","встретил","рукопись","она","предупредила","моей","все","переписывается","несколько","раз","единственное","что","меня","осталось","это","приставка","возвращайся","ты","лучше","свою","безопасную","страну","послушавшись","рукописи","наш","продолжил","свой","путь","вскоре","ему","повстречался","коварный","составитель","рекламных","текстов","напоивший","языком","речью","заманивший","свое","агентство","которое","использовало","снова","снова","своих","проектах","если","переписали","то","живет","там","до","сих","пор"]},sp:{common:["mujer","uno","dolor","más","de","poder","mismo","si"],words:["ejercicio","preferencia","perspicacia","laboral","paño","suntuoso","molde","namibia","planeador","mirar","demás","oficinista","excepción","odio","consecuencia","casi","auto","chicharra","velo","elixir","ataque","no","odio","temporal","cuórum","dignísimo","facilismo","letra","nihilista","expedición","alma","alveolar","aparte","león","animal","como","paria","belleza","modo","natividad","justo","ataque","séquito","pillo","sed","ex","y","voluminoso","temporalidad","verdades","racional","asunción","incidente","marejada","placenta","amanecer","fuga","previsor","presentación","lejos","necesariamente","sospechoso","adiposidad","quindío","pócima","voluble","débito","sintió","accesorio","falda","sapiencia","volutas","queso","permacultura","laudo","soluciones","entero","pan","litro","tonelada","culpa","libertario","mosca","dictado","reincidente","nascimiento","dolor","escolar","impedimento","mínima","mayores","repugnante","dulce","obcecado","montaña","enigma","total","deletéreo","décima","cábala","fotografía","dolores","molesto","olvido","paciencia","resiliencia","voluntad","molestias","magnífico","distinción","ovni","marejada","cerro","torre","y","abogada","manantial","corporal","agua","crepúsculo","ataque","desierto","laboriosamente","angustia","afortunado","alma","encefalograma","materialidad","cosas","o","renuncia","error","menos","conejo","abadía","analfabeto","remo","fugacidad","oficio","en","almácigo","vos","pan","represión","números","triste","refugiado","trote","inventor","corchea","repelente","magma","recusado","patrón","explícito","paloma","síndrome","inmune","autoinmune","comodidad","ley","vietnamita","demonio","tasmania","repeler","apéndice","arquitecto","columna","yugo","computador","mula","a","propósito","fantasía","alias","rayo","tenedor","deleznable","ventana","cara","anemia","corrupto"]},latin:{common:["lorem","ipsum","dolor","sit","amet","consectetur","adipisicing","elit"],words:["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus","tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus","quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod","explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]}},an=/^lorem([a-z]*)(\d*)(-\d*)?$/i;function sn(e,t){return Math.floor(Math.random()*(t-e)+e)}function un(e,t){for(var n=e.length,r=Math.min(n,t),i=[];i.length3&&t<=6?sn(0,1):t>6&&t<=12?sn(0,2):sn(1,4);for(var i,o=0;o0&&!o.startsWith("-")?(r.push(o.slice(0,a)),r.push(o.slice(a))):r.push(o)}}catch(e){i.e(e)}finally{i.f()}r.length&&(n.classNames=r.filter(Pn),n.block=xn(n.classNames),Sn(e,n.classNames.join(" ")))}(e),function(e,t,n){var r,i=yn(e),o=[],a=n.options,s=t.slice(1).concat(e),u=S(i.classNames);try{for(u.s();!(r=u.n()).done;){var c=r.value,l="",f=void 0,h=c;(f=c.match(pn))&&(l=wn(s,f[1].length,n.context)+a["bem.element"]+f[2],o.push(l),c=c.slice(f[0].length)),(f=c.match(dn))&&(l||(l=wn(s,f[1].length),o.push(l)),o.push("".concat(l).concat(a["bem.modifier"]).concat(f[2])),c=c.slice(f[0].length)),c===h&&o.push(h)}}catch(e){u.e(e)}finally{u.f()}var p=o.filter(Pn);p.length&&Sn(e,p.join(" "))}(e,t,n)}function yn(e){if(!e._bem){var t="";if(e.attributes){var n,r=S(e.attributes);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("class"===i.name&&i.value){t=_n(i.value);break}}}catch(e){r.e(e)}finally{r.f()}}e._bem=On(t)}return e._bem}function bn(e){return e._bem||(e._bem=On(e.attributes&&e.attributes.class||"")),e._bem}function On(e){var t=e?e.split(/\s+/):[];return{classNames:t,block:xn(t)}}function wn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=0,i=Math.max(e.length-t,r);do{var o=e[i];if(o){var a=yn(o);if(a.block)return a.block}}while(ri&&(i=a.index))}}catch(e){o.e(e)}finally{o.f()}-1!==i&&(t.field+=i+1)}function Nn(e){return!e.implied||"raw"!==e.valueType||!!e.value&&e.value.length>0}function Fn(e){for(var t,n=[],r={pos:0,text:e},i=r.pos,o=r.pos;r.pos1&&void 0!==arguments[1]?arguments[1]:e.pos;return e.text.charCodeAt(t)}function zn(e){return e>=65&&e<=90}function Un(e){return zn(e)||e>47&&e<58||e===An.Underscore||e===An.Dash}function Bn(e,t){var n=t.comment;if(!(n.enabled&&n.trigger&&e.name&&e.attributes))return!1;var r,i=S(e.attributes);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.name&&n.trigger.includes(o.name))return!0}}catch(e){i.e(e)}finally{i.f()}return!1}function Zn(e,t,n){var r,i={},o=n.out,a=S(e.attributes);try{for(a.s();!(r=a.n()).done;){var s=r.value;s.name&&s.value&&(i[s.name.toUpperCase()]=s.value)}}catch(e){a.e(e)}finally{a.f()}var u,c=S(t);try{for(c.s();!(u=c.n()).done;){var l=u.value;"string"==typeof l?Wt(o,l):i[l.name]&&(Wt(o,l.before),Dn(i[l.name],n),Wt(o,l.after))}}catch(e){c.e(e)}finally{c.f()}}(Rn=An||(An={}))[Rn.Start=91]="Start",Rn[Rn.End=93]="End",Rn[Rn.Underscore=95]="Underscore",Rn[Rn.Dash=45]="Dash";var Vn=/^<([\w\-:]+)[\s>]/,Wn=new Set(["for","while","of","async","await","const","let","var","continue","break","debugger","do","export","import","in","instanceof","new","return","switch","this","throw","try","catch","typeof","void","with","yield"]);function Xn(e,t){var n=Cn(t);return n.comment=function(e){var t=e.options;return{enabled:t["comment.enabled"],trigger:t["comment.trigger"],before:t["comment.before"]?Fn(t["comment.before"]):void 0,after:t["comment.after"]?Fn(t["comment.after"]):void 0}}(t),jn(e,Yn,n),n.out.value}function Yn(e,t,n,r,i){var o=r.out,a=r.config,s=Kn(e,t,n,r),u=function(e){var t=e.config,n=e.parent;if(!n||Qn(n)||n.name&&t.options["output.formatSkip"].includes(n.name))return 0;return 1}(r);if(o.level+=u,s&&Xt(o,!0),e.name){var c=function(e,t){return tn(e,t.options["output.tagCase"])}(e.name,a);if(function(e,t){Bn(e,t)&&t.comment.before&&Zn(e,t.comment.before,t)}(e,r),Wt(o,"<".concat(c)),e.attributes){var l,f=S(e.attributes);try{for(f.s();!(l=f.n()).done;){var h=l.value;Nn(h)&&Gn(h,r)}}catch(e){f.e(e)}finally{f.f()}}if(!e.selfClosing||e.children.length||e.value){if(Wt(o,">"),!Hn(e,r,i)){if(e.value){var p=e.value.some(Jn)||function(e,t){if(e.length&&"string"==typeof e[0]){var n=Vn.exec(e[0]);if((null==n?void 0:n.length)&&!t.options.inlineElements.includes(n[1].toLowerCase()))return!0}return!1}(e.value,a);p&&Xt(r.out,++o.level),Dn(e.value,r),p&&Xt(r.out,--o.level)}if(e.children.forEach(i),!e.value&&!e.children.length){var d=a.options["output.formatLeafNode"]||a.options["output.formatForce"].includes(e.name);d&&Xt(r.out,++o.level),Dn($n,r),d&&Xt(r.out,--o.level)}}Wt(o,"")),function(e,t){Bn(e,t)&&t.comment.after&&Zn(e,t.comment.after,t)}(e,r)}else Wt(o,"".concat(function(e){switch(e.options["output.selfClosingStyle"]){case"xhtml":return" /";case"xml":return"/";default:return""}}(a),">"))}else!Hn(e,r,i)&&e.value&&(Dn(e.value,r),e.children.forEach(i));if(s&&t===n.length-1&&r.parent){var m=Qn(r.parent)?0:1;Xt(o,o.level-m)}o.level-=u}function Gn(e,t){var n=t.out,r=t.config;if(e.name){var i=r.options["markup.attributes"],o=r.options["markup.valuePrefix"],a=e.name,s=e.value,u=Ht(e,r,!0),c=Ht(e,r);i&&(a=er(a,i,e.multiple)||a),a=Gt(a,r),r.options["jsx.enabled"]&&e.multiple&&(u="{",c="}");var l=o?er(e.name,o,e.multiple):null;if(l&&1===(null==s?void 0:s.length)&&"string"==typeof s[0]){var f=s[0];s=[tr(f)?"".concat(l,".").concat(f):"".concat(l,"['").concat(f,"']")],r.options["jsx.enabled"]&&(u="{",c="}")}Kt(e,r)&&!s?r.options["output.compactBoolean"]||(s=[a]):s||(s=$n),Wt(n," "+a),s?(Wt(n,"="+u),Dn(s,t),Wt(n,c)):"html"!==r.options["output.selfClosingStyle"]&&Wt(n,"="+u+c)}}function Hn(e,t,n){if(e.value&&e.children.length){var r=e.value.findIndex(Mn);if(-1!==r){Dn(e.value.slice(0,r),t);var i=t.out.line,o=r+1;return e.children.forEach(n),t.out.line!==i&&"string"==typeof e.value[o]&&Wt(t.out,e.value[o++].trimLeft()),Dn(e.value.slice(o),t),!0}}return!1}function Kn(e,t,n,r){var i=r.config,o=r.parent;if(!i.options["output.format"])return!1;if(0===t&&!o)return!1;if(o&&Qn(o)&&1===n.length)return!1;if(Qn(e)&&(Qn(n[t-1])||Qn(n[t+1])||e.value.some(Jn)||e.value.some(Mn)&&e.children.length))return!0;if(Jt(e,i)){if(0===t){for(var a=0;a=i.options["output.inlineBreak"])return!0}for(var l=0,f=e.children.length;lu&&(u=l)}}catch(e){c.e(e)}finally{c.f()}i.level++;for(var f=0;f=0;t--){var n=e[t];if("AbbreviationNode"===n.type&&n.repeat)return n.repeat}}(t);e.name=e.attributes=void 0,e.value=[fn(i,a,!s||0===s.value)],e.repeat&&t.length>1&&rn(e,t,n)}}(e,t,n),"xsl"===n.syntax&&function(e){var t;"xsl:variable"!==(t=e.name)&&"xsl:with-param"!==t||!e.attributes||!e.children.length&&!e.value||(e.attributes=e.attributes.filter(hn))}(e),"markup"===n.type&&En(e),n.options["bem.enabled"]&&gn(e,t,n)}(sr=ar||(ar={})).Raw="Raw",sr.Property="Property";var fr=/^([a-z-]+)(?:\s*:\s*([^\n\r;]+?);*)?$/,hr={value:!0};function pr(e,t){var n=t.match(fr);if(n){var r,i={},o=n[2]?n[2].split("|").map(mr):[],a=S(o);try{for(a.s();!(r=a.n()).done;){var s,u=S(r.value);try{for(u.s();!(s=u.n()).done;){gr(s.value,i)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){a.e(e)}finally{a.f()}return{type:ar.Property,key:e,property:n[1],value:o,keywords:i,dependencies:[]}}return{type:ar.Raw,key:e,value:t}}function dr(e,t){return e.key===t.key?0:e.key2&&void 0!==arguments[2]&&arguments[2];if((e=e.toLowerCase())===(t=t.toLowerCase()))return 1;if(!e||!t||e.charCodeAt(0)!==t.charCodeAt(0))return 0;var r=e.length,i=t.length;if(!n&&r>i)return 0;for(var o=Math.min(r,i),a=Math.max(r,i),s=1,u=1,c=a,l=0,f=0,h=!1,p=!1;s1&&void 0!==arguments[1]?arguments[1]:4;return e.toFixed(t).replace(/\.?0+$/,"")}function xr(e){return!(e%17)}function kr(e){return(e>>4).toString(16)}function Sr(e){return function(e,t){for(;e.length0)}}function jr(e,t,n){e.important&&(n&&Vt(t," "),Vt(t,"!important"))}function Cr(e,t,n){for(var r=0,i=-1;r2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=null,a=0,s=S(t);try{for(s.s();!(n=s.n()).done;){var u=n.value,c=yr(e,Dr(u),i);if(1===c)return u;c&&c>=a&&(a=c,o=u)}}catch(e){s.e(e)}finally{s.f()}return a>=r?o:null}function Dr(e){return"string"==typeof e?e:e.key}function Nr(e,t,n,r){var i;if(n){if(i=Mr(e,Object.keys(n.keywords),r))return n.keywords[i];var o,a=S(n.dependencies);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(i=Mr(e,Object.keys(s.keywords),r))return s.keywords[i]}}catch(e){a.e(e)}finally{a.f()}}return(i=Mr(e,t.options["stylesheet.keywords"],r))?Lr(i):null}function Fr(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:{index:1},i=[],o=S(e.value);try{for(o.s();!(n=o.n()).done;){var a=n.value;switch(a.type){case"ColorValue":i.push(qr(r.index++,Or(a,t.options["stylesheet.shortHex"])));break;case"Literal":i.push(qr(r.index++,a.value));break;case"NumberValue":i.push(qr(r.index++,"".concat(a.value).concat(a.unit)));break;case"StringValue":var s="single"===a.quote?"'":'"';i.push(qr(r.index++,s+a.value+s));break;case"FunctionCall":i.push(qr(r.index++,a.name),Lr("("));for(var u=0,c=a.arguments.length;usrc:m+img","ri:t|ri:type":"pic>src:t+img","!!!":"{}",doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+title{${1:Document}})+body","!|html:5":"!!!+doc",c:"{\x3c!-- ${0} --\x3e}","cc:ie":"{\x3c!--[if IE]>${0}\x3c!--\x3e${0}\x3c!--xsl:when+xsl:otherwise",xsl:"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}","!!!":'{}'}),options:{"output.selfClosingStyle":"xml"}},jsx:{options:{"jsx.enabled":!0,"markup.attributes":{class:"className","class*":"styleName",for:"htmlFor"},"markup.valuePrefix":{"class*":"styles"}}},vue:{options:{"markup.attributes":{"class*":":class"}}},svelte:{options:{"jsx.enabled":!0}},pug:{snippets:Hr({"!!!":"{doctype html}"})},stylesheet:{snippets:Hr({"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${2});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",ac:"align-content:start|end|flex-start|flex-end|center|space-between|space-around|stretch|space-evenly",ai:"align-items:start|end|flex-start|flex-end|center|baseline|stretch",anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:"animation-delay:time",animdir:"animation-direction:normal|reverse|alternate|alternate-reverse",animdur:"animation-duration:${1:0}s",animfm:"animation-fill-mode:both|forwards|backwards",animic:"animation-iteration-count:1|infinite",animn:"animation-name",animps:"animation-play-state:running|paused",animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:"appearance:none",as:"align-self:start|end|auto|flex-start|flex-end|center|baseline|stretch",b:"bottom",bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:${1:#000}",bdbi:"border-bottom-image:url(${0})",bdbk:"border-break:close",bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:"border-bottom-left-radius",bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:"border-bottom-right-radius",bdbs:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color:${1:#000}",bdci:"border-corner-image:url(${0})|continue",bdcl:"border-collapse:collapse|separate",bdf:"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space",bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:${1:#000}",bdlen:"border-length",bdli:"border-left-image:url(${0})",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:${1:#000}",bdri:"border-right-image:url(${0})",bdrs:"border-radius",bdrst:"border-right-style",bdrw:"border-right-width",bds:"border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset",bdsp:"border-spacing",bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:${1:#000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:"border-top-left-radius",bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bbs:"border-block-start",bbe:"border-block-end",bis:"border-inline-start",bie:"border-inline-end",bfv:"backface-visibility:hidden|visible",bg:"background:${1:#000}","bg:n":"background: none",bga:"background-attachment:fixed|scroll",bgbk:"background-break:bounding-box|each-box|continuous",bgc:"background-color:${1:#fff}",bgcp:"background-clip:padding-box|border-box|content-box|no-clip",bgi:"background-image:url(${0})",bgo:"background-origin:padding-box|border-box|content-box",bgp:"background-position:${1:0} ${2:0}",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat:no-repeat|repeat-x|repeat-y|space|round",bgsz:"background-size:contain|cover",bs:"block-size",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:#000}|none",bxsz:"box-sizing:border-box|content-box|border-box",c:"color:${1:#000}",cg:"column-gap",cr:"color:rgb(${1:0}, ${2:0}, ${3:0})",cra:"color:rgba(${1:0}, ${2:0}, ${3:0}, ${4:.5})",cl:"clear:both|left|right|none",cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters(${0})",coi:"counter-increment",colm:"columns",colmc:"column-count",colmf:"column-fill",colmg:"column-gap",colmr:"column-rule",colmrc:"column-rule-color",colmrs:"column-rule-style",colmrw:"column-rule-width",colms:"column-span",colmw:"column-width",cor:"counter-reset",cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:"caption-side:top|bottom",cur:"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text",d:"display:block|none|flex|inline-flex|inline|inline-block|grid|inline-grid|subgrid|list-item|run-in|contents|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group",ec:"empty-cells:show|hide",f:"font:${1:1em} ${2:sans-serif}",fd:"font-display:auto|block|swap|fallback|optional",fef:"font-effect:none|engrave|emboss|outline",fem:"font-emphasize",femp:"font-emphasize-position:before|after",fems:"font-emphasize-style:none|accent|dot|circle|disc",ff:"font-family:serif|sans-serif|cursive|fantasy|monospace",fft:'font-family:"Times New Roman", Times, Baskerville, Georgia, serif',ffa:'font-family:Arial, "Helvetica Neue", Helvetica, sans-serif',ffv:"font-family:Verdana, Geneva, sans-serif",fl:"float:left|right|none",fs:"font-style:italic|normal|oblique",fsm:"font-smoothing:antialiased|subpixel-antialiased|none",fst:"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",fv:"font-variant:normal|small-caps",fvs:"font-variation-settings:normal|inherit|initial|unset",fw:"font-weight:normal|bold|bolder|lighter",fx:"flex",fxb:"flex-basis:fill|max-content|min-content|fit-content|content",fxd:"flex-direction:row|row-reverse|column|column-reverse",fxf:"flex-flow",fxg:"flex-grow",fxsh:"flex-shrink",fxw:"flex-wrap:nowrap|wrap|wrap-reverse",fsz:"font-size",fsza:"font-size-adjust",g:"gap",gtc:"grid-template-columns:repeat(${0})|minmax()",gtr:"grid-template-rows:repeat(${0})|minmax()",gta:"grid-template-areas",gt:"grid-template",gg:"grid-gap",gcg:"grid-column-gap",grg:"grid-row-gap",gac:"grid-auto-columns:auto|minmax()",gar:"grid-auto-rows:auto|minmax()",gaf:"grid-auto-flow:row|column|dense|inherit|initial|unset",gd:"grid",gc:"grid-column",gcs:"grid-column-start",gce:"grid-column-end",gr:"grid-row",grs:"grid-row-start",gre:"grid-row-end",ga:"grid-area",h:"height",is:"inline-size",jc:"justify-content:start|end|stretch|flex-start|flex-end|center|space-between|space-around|space-evenly",ji:"justify-items:start|end|center|stretch",js:"justify-self:start|end|center|stretch",l:"left",lg:"background-image:linear-gradient(${1})",lh:"line-height",lis:"list-style",lisi:"list-style-image",lisp:"list-style-position:inside|outside",list:"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman",lts:"letter-spacing:normal",m:"margin",mah:"max-height",mar:"max-resolution",maw:"max-width",mb:"margin-bottom",mih:"min-height",mir:"min-resolution",miw:"min-width",ml:"margin-left",mr:"margin-right",mt:"margin-top",mbs:"margin-block-start",mbe:"margin-block-end",mis:"margin-inline-start",mie:"margin-inline-end",ol:"outline",olc:"outline-color:${1:#000}|invert",olo:"outline-offset",ols:"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset",olw:"outline-width:thin|medium|thick","op|opa":"opacity",ord:"order",ori:"orientation:landscape|portrait",orp:"orphans",ov:"overflow:hidden|visible|hidden|scroll|auto",ovs:"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee",ovx:"overflow-x:hidden|visible|hidden|scroll|auto",ovy:"overflow-y:hidden|visible|hidden|scroll|auto",p:"padding",pb:"padding-bottom",pgba:"page-break-after:auto|always|left|right",pgbb:"page-break-before:auto|always|left|right",pgbi:"page-break-inside:auto|avoid",pl:"padding-left",pos:"position:relative|absolute|relative|fixed|static",pr:"padding-right",pt:"padding-top",pbs:"padding-block-start",pbe:"padding-block-end",pis:"padding-inline-start",pie:"padding-inline-end",spbs:"scroll-padding-block-start",spbe:"scroll-padding-block-end",spis:"scroll-padding-inline-start",spie:"scroll-padding-inline-end",q:"quotes",qen:"quotes:'\\201C' '\\201D' '\\2018' '\\2019'",qru:"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'",r:"right",rg:"row-gap",rsz:"resize:none|both|horizontal|vertical",t:"top",ta:"text-align:left|center|right|justify",tal:"text-align-last:left|center|right",tbl:"table-layout:fixed",td:"text-decoration:none|underline|overline|line-through",te:"text-emphasis:none|accent|dot|circle|disc|before|after",th:"text-height:auto|font-size|text-size|max-size",ti:"text-indent",tj:"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan",to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:"text-overflow:ellipsis|clip",tr:"text-replace",trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:"transform-origin",trfs:"transform-style:preserve-3d",trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:"text-transform:uppercase|lowercase|capitalize|none",tw:"text-wrap:none|normal|unrestricted|suppress",us:"user-select:none",v:"visibility:hidden|visible|collapse",va:"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub","w|wid":"width",whs:"white-space:nowrap|pre|pre-wrap|pre-line|normal",whsc:"white-space-collapse:normal|keep-all|loose|break-strict|break-all",wido:"widows",wm:"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl",wob:"word-break:normal|keep-all|break-all",wos:"word-spacing",wow:"word-wrap:none|unrestricted|suppress|break-word|normal",z:"z-index",zom:"zoom:1"})},sass:{options:{"stylesheet.after":""}},stylus:{options:{"stylesheet.between":" ","stylesheet.after":""}}};function Hr(e){var t={};return Object.keys(e).forEach((function(n){var r,i=S(n.split("|"));try{for(i.s();!(r=i.n()).done;){var o=r.value;t[o]=e[n]}}catch(e){i.e(e)}finally{i.f()}})),t}function Kr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.type||"markup",r=e.syntax||Xr[n];return Object.assign(Object.assign(Object.assign({},Yr),e),{type:n,syntax:r,variables:Jr(n,r,"variables",e,t),snippets:Jr(n,r,"snippets",e,t),options:Jr(n,r,"options",e,t)})}function Jr(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=Gr[e],a=i[e],s=Gr[t],u=i[t];return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Yr[n]),o&&o[n]),s&&s[n]),a&&a[n]),u&&u[n]),r[n])}!function(e){e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Escape=92]="Escape"}(Zr||(Zr={})),(Wr=Vr||(Vr={}))[Wr.SquareL=91]="SquareL",Wr[Wr.SquareR=93]="SquareR",Wr[Wr.RoundL=40]="RoundL",Wr[Wr.RoundR=41]="RoundR",Wr[Wr.CurlyL=123]="CurlyL",Wr[Wr.CurlyR=125]="CurlyR";var ei;f(f(f({},Vr.SquareL,Vr.SquareR),Vr.RoundL,Vr.RoundR),Vr.CurlyL,Vr.CurlyR);!function(e){e[e.Tab=9]="Tab",e[e.Space=32]="Space",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Colon=58]="Colon",e[e.Equals=61]="Equals",e[e.AngleLeft=60]="AngleLeft",e[e.AngleRight=62]="AngleRight"}(ei||(ei={}));var ti=function(e){return e.charCodeAt(0)};"#.*:$-_!@%^+>/".split("").map(ti);function ni(e,t){var n=Kr(t);return"stylesheet"===n.type?function(e,t){return function(e,t){var n,r=Zt(t.options),i=t.options["output.format"];(null===(n=t.context)||void 0===n?void 0:n.name)===_r&&(e=e.filter((function(e){return e.snippet})));for(var o=0;or&&hi(n[i-1]);)i--;return{from:t.from+r,to:t.from+i}}function ai(e){return e.selection.main.from}function si(e,t){return e.doc.sliceString(t.from,t.to)}function ui(e,t){return t>=e.from&&t<=e.to}function ci(e){return'"'===e||"'"===e}function li(e,t){var n=t.from,r=t.to,i=si(e,t);return ci(i[0])&&n++,ci(i[i.length-1])&&r--,{from:n,to:r}}function fi(e,t){var n,r={},i=S(t.getChildren("Attribute"));try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.getChild("AttributeName");if(a){var s=si(e,a),u=o.getChild("AttributeValue");r[s]=u?si(e,li(e,u)):null}}}catch(e){i.e(e)}finally{i.f()}return r}function hi(e){return/^[\s\n\r]+$/.test(e)}function pi(e){return e.from===e.to}function di(e){return e.length>0?e[e.length-1]:void 0}var mi={OpenTag:"open",CloseTag:"close",SelfClosingTag:"selfClose"};function vi(e,t,n){for(var r={type:"css",ancestors:[],current:null,inline:!1,embedded:n},i=[],o=Object(u.I)(e).resolveInner(t,-1);o;o=o.parent)if("RuleSet"===o.name){var a=bi(o);i.push({name:si(e,a),type:"selector",range:o})}else if("Declaration"===o.name){var s=Oi(o),c=s.name,l=s.value;l&&ui(l,t)&&i.push({name:si(e,l),type:"propertyValue",range:l}),c&&i.push({name:si(e,c),type:"propertyName",range:c})}var f=i.shift();if(f){var h="selector"===f.type?{from:f.range.from,to:f.range.from+f.name.length}:f.range;ui(h,t)?(r.current=f,f.range=h):i.unshift(f)}return r.ancestors=i.reverse(),r}function gi(e,t){for(var n={type:"html",ancestors:[],current:null},r=Object(u.I)(e).resolveInner(t);r;r=r?r.parent:null)if(r.name in mi){var i=yi(e,r);i&&(n.current=I(Q({},i),{type:mi[r.name]}),r=r.parent)}else if("Element"===r.name){var o=r.getChild("OpenTag");if(o){var a=yi(e,o);a&&n.ancestors.push(a)}}return n.ancestors.reverse(),function(e,t,n){var r;if("open"===(null==(r=n.current)?void 0:r.type)){for(var i=Object(u.I)(e).resolve(n.current.range.from,1);i&&"OpenTag"!==i.name;)i=i.parent;if(i){var o,a=S(i.getChildren("Attribute"));try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.from>t)break;if(ui(s,t)&&"style"===wi(e,s)){var c=s.getChild("AttributeValue");if(c){var l=li(e,c);ui(l,t)&&(n.css=xi(si(e,l),t-l.from,l.from))}}}}catch(e){a.e(e)}finally{a.f()}}}}(e,t,n),n}function yi(e,t){var n=t.getChild("TagName");if(n)return{name:si(e,n).toLowerCase(),range:t}}function bi(e){for(var t=e.from,n=t,r=e.firstChild;r&&"Block"!==r.name;r=r.nextSibling)n=r.to;return{from:t,to:n}}function Oi(e){var t,n,r=e.firstChild;return"PropertyName"===(null==r?void 0:r.name)&&(t=r,":"===(null==(r=r.nextSibling)?void 0:r.name)&&(r=r.nextSibling),r&&(n={from:r.from,to:e.lastChild.to})),{name:t,value:n}}function wi(e,t){var n=t.getChild("AttributeName");return n?si(e,n).toLowerCase():""}function xi(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i={type:"css",ancestors:[],current:null,inline:!0,embedded:{from:t+r,to:t+r+e.length}},o=ki(e,t),a=S(o);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.value&&ui(s.value,t)){i.current={name:e.substring(s.value.from,s.value.to).trim(),type:"propertyValue",range:{from:r+s.value.from,to:r+s.value.to}},i.ancestors.push({name:e.substring(s.name.from,s.name.to).trim(),type:"propertyName",range:{from:r+s.name.from,to:r+s.value.to}});break}if(ui(s.name,t)){var u=s.value?s.value.to:s.name.to;i.current={name:e.substring(s.name.from,s.name.to).trim(),type:"propertyName",range:{from:r+s.name.from,to:r+u}};break}}}catch(e){a.e(e)}finally{a.f()}return i}function ki(e){for(var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length,i=" \t\n\r",o=[],a=0;ar)break}else":"===s?n&&!n.value&&(n.value={from:-1,to:-1}):n?-1!==(null==(t=n.value)?void 0:t.from)||i.includes(s)||(n.value.from=n.value.to=a):i.includes(s)||(n={name:{from:a,to:a}},o.push(n))}return n&&(n.value?n.value.to++:n.name.to++),o}var Si=function(e){return e.html="html",e.xml="xml",e.xsl="xsl",e.jsx="jsx",e.tsx="tsx",e.vue="vue",e.haml="haml",e.jade="jade",e.pug="pug",e.slim="slim",e.css="css",e.scss="scss",e.less="less",e.sass="sass",e.sss="sss",e.stylus="stylus",e.postcss="postcss",e}(Si||{});function _i(e,t){var n=qi(e)||Si.html,r=Ii(e),i={"output.field":Pi,"output.indent":"\t","output.format":!t,"output.attributeQuotes":r.attributeQuotes,"stylesheet.shortHex":r.shortHex};return n===Si.html&&(i["output.selfClosingStyle"]=r.markupStyle,i["output.compactBoolean"]="html"===r.markupStyle),Ui(n)&&(r.comments&&(i["comment.enabled"]=!0,r.commentsTemplate&&(i["comment.after"]=r.commentsTemplate)),i["bem.enabled"]=r.bem),i}function Pi(e,t){return t?"${".concat(e,":").concat(t,"}"):"${".concat(e,"}")}function Ei(e){var t=e.text.match(/^\s+/);return t?t[0]:""}var Ti={};function ji(e,t,n){var r={cache:Ti},i={"output.field":Pi};n&&(Object.assign(r,n),n.options&&Object.assign(i,n.options)),r.options=i;var o=Ii(e);return o.config&&(r=Kr(r,o.config)),ni(t,r)}function Ci(e,t){for(var n=Object(u.I)(e).resolve(t,1);n&&"Element"!==n.name;)n=n.parent;if(n){var r=n.getChild("SelfClosingTag");if(r)return{name:Ai(e,r),attributes:fi(e,r),open:r};var i=n.getChild("OpenTag");if(i){var o=n.getChild("CloseTag"),a={name:Ai(e,i),attributes:fi(e,i),open:i};return o&&(a.close=o),a}}}function Ai(e,t){var n=t.getChild("TagName");return n?si(e,n):""}function Ri(e,t){var n=function(e,t){var n,r=qi(e),i="number"==typeof t?function(e,t){return a.cssLanguage.isActiveAt(e,t)?vi(e,t):o.htmlLanguage.isActiveAt(e,t)?gi(e,t):void 0}(e,t):t;"html"===(null==i?void 0:i.type)&&i.css?(n=!0,r=Si.css,i=i.css):"css"===(null==i?void 0:i.type)&&(r=Si.css);return{type:zi(r),syntax:r,inline:n,context:i}}(e,t),r=n.context,i={type:n.type,syntax:n.syntax||Si.html,options:_i(e,n.inline)};return r&&("html"===r.type&&r.ancestors.length?i.context=Vi(e,r):"css"===r.type&&(i.context=Wi(r))),i}var $i={syntax:Si.html,mark:!0,preview:{},previewEnabled:!0,autoRenameTags:!0,markTagPairs:!0,previewOpenTag:!1,attributeQuotes:"double",markupStyle:"html",comments:!1,commentsTemplate:"\x3c!-- /[#ID][.CLASS] --\x3e",bem:!1,completionBoost:99},Qi=i.h.define({combine:function(e){Ti={};var t,n=Q({},$i),r=n.preview,i=S(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;Object.assign(n,o),o.preview&&(n.preview=Q(Q({},r),o.preview))}}catch(e){i.e(e)}finally{i.f()}return n}});function Ii(e,t){return e.facet(Qi)}var Mi=[Si.html,Si.vue],Di=[Si.jsx,Si.tsx],Ni=[Si.xml,Si.xsl].concat(Di),Fi=[Si.css,Si.scss,Si.less];[Si.haml,Si.jade,Si.pug,Si.slim].concat(Mi,l(Ni),Di);var Li=[Si.sass,Si.sss,Si.stylus,Si.postcss].concat(Fi);function qi(e){return Ii(e).syntax}function zi(e){return e&&Li.includes(e)?"stylesheet":"markup"}function Ui(e){return Mi.includes(e)||function(e){return Ni.includes(e)}(e)}function Bi(e){return Fi.includes(e)}function Zi(e){return Di.includes(e)}function Vi(e,t){var n=di(t.ancestors);if(n){for(var r=Object(u.I)(e).resolve(n.range.from,1);r&&"OpenTag"!==r.name;)r=r.parent;return{name:n.name,attributes:r?fi(e,r):{}}}}function Wi(e){if(e.inline)return{name:"@@property"};var t=di(e.ancestors),n="@@global";return e.current?"propertyValue"===e.current.type&&t?n=t.name:"selector"!==e.current.type&&"propertyName"!==e.current.type||t||(n="@@section"):t||(n="@@section"),{name:n}}function Xi(e,t,n){var s=document.createElement("div");s.className="emmet-preview","error"===t&&s.classList.add("emmet-preview_error");var c=t===Si.css?a.css:o.html;n&&t in n&&(c=n[t]);var l=new r.c({doc:e,root:null==n?void 0:n.root,extensions:[i.g.readOnly.of(!0),Object(u.H)(u.n,{fallback:!0}),t===Si.css?Object(a.css)():Object(o.html)(),c()],parent:s});return s.update=function(e){var t=l.state.update({changes:{from:0,to:l.state.doc.length,insert:e}});l.dispatch(t)},s}var Yi=a.cssLanguage.data.of({autocomplete:function(e){var t=e.state.field(eo);return"abbreviation"===(null==t?void 0:t.type)&&t.preview&&ui(t.range,e.pos)?{from:t.range.from,to:t.range.to,filter:!1,update:function(e,t,n,r){var i=r.state.field(eo);return i&&"error"!==i.type&&ui(i.range,r.pos)?I(Q({},e),{from:i.range.from,to:i.range.to,options:vo(r.state,i)}):null},options:vo(e.state,t)}:null}}),Gi="<",Hi=r.a.mark({class:"emmet-tracker"}),Ki=i.n.define(),Ji=i.n.define(),eo=i.o.define({create:function(){return null},update:function(e,t){if(t.annotation(s.i))return null;var n,r=S(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(Ki))return null;if(i.is(Ji)){var u=t.newSelection.main,c=co(t.state,u.from);if(c)return fo(t.state,u,{forced:!0,config:c})}}}catch(e){r.e(e)}finally{r.f()}return t.docChanged?function(e,t,n){if(function(e){if(Array.isArray(e.values))return e.values.some((function(e){var t;return e&&"ActiveSnippet"===(null==(t=e.constructor)?void 0:t.name)}));return!1}(e))return null;if((!t||t.inactive)&&(n.changes.iterChanges((function(n,r,i,s,u){u.length&&(t=function(e,t,n){var r;if(1!==n.length)return null;var i=e.doc.lineAt(t),s=i.text.substring(Math.max(0,t-i.from-1),t-i.from);if(!mo(s,n,function(e,t){if(a.cssLanguage.isActiveAt(e,t))return Si.css;if(o.htmlLanguage.isActiveAt(e,t))return Si.html;return""}(e,t)))return null;var u=co(e,t);if(!u)return null;if("stylesheet"===u.type){if(!mo(s,n,Si.css))return null;var c=null==(r=u.context)?void 0:r.name;if(c&&!c.startsWith("@@")&&"#"!==n)return null}var l=u.syntax||Si.html,f=t,h=t+n.length;Zi(l)&&s===Gi&&(f-=Gi.length);return fo(e,{from:f,to:h},{config:u})}(e,i,u.toString())||t)})),!t||!t.inactive))return t;return n.changes.iterChanges((function(n,r,i,o,a){if(t){var s=t.range;if(ui(s,n)){if(ui(s,i)){var u=r-n,c=o-n,l=s.to+c-u;if(l<=s.from||ho(a.toString()))t=null;else{var f=t.inactive?s:{from:s.from,to:l},h=fo(e,f,{config:t.config,forced:t.forced});t=h||I(Q({},t),{inactive:!0})}}}else t.inactive||(t=null)}})),t}(t.state,e,t):e}}),to=i.o.define({create:no,update:function(e,t){return t.docChanged||t.selection?no(t.state,e):t.state.field(eo)?e:null},provide:function(e){return r.x.from(e)}});function no(e,t){var n=e.field(eo);if(n&&!n.inactive&&"active"!==Object(s.g)(e)){if("stylesheet"===n.config.type)return null;t&&t.tracker.type!==n.type&&(t=null);var r=n.range;if(function(e,t){if("active"===Object(s.g)(e))return!1;var n=Ii(e);if(!n.previewEnabled)return!1;if(Array.isArray(n.previewEnabled)){var r=t.config,i=r.type,o=r.syntax;if(!n.previewEnabled.includes(i)&&!n.previewEnabled.includes(o))return!1}return"error"===t.type||(!t.simple||t.forced)&&!!t.abbreviation&&ui(t.range,ai(e))}(e,n))return t||{pos:r.from,above:!1,arrow:!1,tracker:n,create:function(){var t=e.facet(Qi).preview,r="",i="";"error"===n.type?(r=n.error.message,i="error"):(r=n.preview,i=n.config.syntax||Si.html);var o=Xi(r,i,t);return{dom:o,update:function(e){var t=e.state.field(eo);if(t&&o.update){var n="error"===t.type?t.error.message:t.preview;o.update(n)}}}}}}return null}var ro=r.e.fromClass(function(){function e(){b(this,e),M(this,"decorations"),this.decorations=r.a.none}return w(e,[{key:"update",value:function(e){var t=e.state.field(eo),n=[];if(t&&!t.inactive){var i=t.range;pi(i)||n.push(Hi.range(i.from,i.to)),this.decorations=r.a.set(n,!0)}else this.decorations=r.a.none}}]),e}(),{decorations:function(e){return e.decorations}});function io(e,t){var n=t.range,r=n.from,i=n.to,o=ji(e.state,t.abbreviation,t.config),a=Object(s.k)(o);e.dispatch(e.state.update({effects:Ki.of(null)})),a(e,{label:"expand"},r,i)}var oo=function(e){var t=e.state,n=Object(s.j)(t),r=t.field(eo,!1);if(n&&r){if("emmet"===n.type){var i=Ii(t).autocompleteTab;if(!i)return!1;if(Array.isArray(i)){var o=r.config,a=o.type,u=o.syntax;if(!i.includes(a)&&!i.includes(u))return!1}return Object(s.b)(e),!0}return!1}return!(!r||r.inactive||!ui(r.range,ai(t)))&&(io(e,r),!0)},ao=function(e){var t=e.state,n=e.dispatch;return!!t.field(eo,!1)&&(n({effects:Ki.of(null)}),!0)},so=r.c.baseTheme({".emmet-tracker":{textDecoration:"underline 1px green"},".emmet-preview":{fontSize:"0.9em"},".emmet-preview_error":{color:"red"},".cm-completionIcon-emmet::after":{content:'" "',background:'url("'.concat("data:image/svg+xml,%3csvg%20height='393'%20viewBox='0%200%20393%20393'%20width='393'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient%20id='a'%20x1='98.60869%25'%20x2='50%25'%20y1='50%25'%20y2='50%25'%3e%3cstop%20offset='0'%20stop-color='%23cefbad'/%3e%3cstop%20offset='.836972535'%20stop-color='%23cefbad'/%3e%3cstop%20offset='1'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3cpath%20id='b'%20d='m116%2048%20105%2063v34.985l-75-44.999289v67.667289l49.5%2029.347-49.5%2029.346v67.668289l75-45.000289v34.986l-105%2063zm145%2087%20105%2063-105%2063v-34.986l46.690481-28.014-46.690481-28.014z'/%3e%3c/defs%3e%3cg%20fill='none'%20fill-rule='evenodd'%20transform='matrix(.70710678%20-.70710678%20.70710678%20.70710678%20-81.392965%20196.5)'%3e%3ccircle%20cx='196.5'%20cy='196.5'%20fill='%2325272b'%20r='196.5'/%3e%3cuse%20fill='%2392c131'%20xlink:href='%23b'/%3e%3cuse%20fill='url(%23a)'%20xlink:href='%23b'/%3e%3c/g%3e%3c/svg%3e",'") center/contain no-repeat'),display:"inline-block",width:"11px",height:"11px",verticalAlign:"middle"}});function uo(e){return[eo,ro,to,so,Yi,e?Qi.of(e):[],r.q.of([{key:"Tab",run:oo},{key:"Escape",run:ao}])]}function co(e,t){if(a.cssLanguage.isActiveAt(e,t))return lo(e,t,Si.css,vi(e,t));var n=qi(e);if(!Ui(n))return{syntax:n,type:zi(n),options:_i(e)};var r=gi(e,t);return r.css?lo(e,t,Si.css,r.css):r.current?void 0:{syntax:n,type:"markup",context:Vi(e,r),options:_i(e)}}function lo(e,t,n,r){var i=!r.current||"propertyName"===r.current.type||"propertyValue"===r.current.type||function(e,t,n){var r=n.current;if("selector"===(null==r?void 0:r.type)&&r.range.from===t-1){return 1===e.doc.lineAt(r.range.from).text.trim().length}return!1}(e,t,r);if(i)return{syntax:n,type:"stylesheet",context:Wi(r),options:_i(e,r.inline)}}function fo(e,t,n){if(t.from>t.to)return null;var r=si(e,t),i=n.config,o=n.forced;if(n.offset&&(r=r.slice(n.offset)),!r&&!o||ho(r))return null;var a={abbreviation:r,range:t,config:i,forced:!!o,inactive:!1,offset:n.offset||0};try{var s,u=!1;"markup"===i.type&&(u=function(e){if(1===e.children.length&&!e.children[0].children.length){var t=e.children[0];return!t.name||/^[a-z]/i.test(t.name)}return!e.children.length}(s=it(r,{jsx:"jsx"===i.syntax})));var c=function(e){return I(Q({},e),{options:I(Q({},e.options),{"output.field":po,"output.indent":" ","output.baseIndent":""})})}(i),l=ji(e,s||r,c);return l?I(Q({},a),{type:"abbreviation",simple:u,preview:l}):null}catch(e){return a.forced?I(Q({},a),{type:"error",error:e}):null}}function ho(e){return/[\r\n]/.test(e)}function po(e,t){return t}function mo(e,t,n){return function(e,t){return Zi(t)?e===Gi:(Bi(t),""===e||/^[\s>;"\']$/.test(e))}(e,n)&&function(e,t){return Zi(t)?/^[a-zA-Z.#\[\(]$/.test(e):Bi(t)?/^[a-zA-Z!@#]$/.test(e):/^[a-zA-Z.#!@\[\(]$/.test(e)}(t,n)}function vo(e,t,n){var r=e.facet(Qi);return[{label:"Emmet abbreviation",type:"emmet",boost:r.completionBoost,tracker:t,previewConfig:r.preview,preview:null==n?void 0:n.preview,info:go,apply:function(e,n){e.dispatch({annotations:s.i.of(n)}),io(e,t)}}]}function go(e){var t=e.tracker,n=e.previewConfig,r=e.preview;return(null==r?void 0:r.update)?r.update(t.preview):e.preview=r=Xi(t.preview,t.config.syntax||Si.html,n),r}Error,yo("null",0);function yo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{type:e,value:t,priority:n}}f({},45,(function(e){return-e})),f(f(f(f(f({},43,(function(e,t){return e+t})),45,(function(e,t){return e-t})),42,(function(e,t){return e*t})),47,(function(e,t){return e/t})),92,(function(e,t){return Math.floor(e/t)}));var bo=i.n.define(),Oo=i.o.define({create:function(){return null},update:function(e,t){var n,r=S(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(bo)&&(e=i.value)}}catch(e){r.e(e)}finally{r.f()}return e}}),wo=r.c.baseTheme({".emmet-wrap-with-abbreviation":{position:"absolute",top:0,zIndex:2,width:"100%"},".emmet-wrap-with-abbreviation__content":{background:"#fff",margin:"0 auto",padding:"5px",boxSizing:"border-box",width:"100%",maxWidth:"30em",borderBottomLeftRadius:"5px",borderBottomRightRadius:"5px",boxShadow:"0 3px 10px rgba(0, 0, 0, 0.3)"},".emmet-wrap-with-abbreviation__content input":{width:"100%",boxSizing:"border-box"}}),xo=function(e){var t=e.state,n=e.dispatch;if(null===t.field(Oo)){var r=t.selection.main,i=Ci(t,r.from),o=function(e,t,n){if(pi(t)&&n){var r=n.open,i=n.close,o=t.from;if(_o(r,o)||i&&_o(i,o))return{from:r.from,to:i?i.to:r.to};if(i)return oi(e,{from:r.to,to:i.from})}return t}(t,r,i),a=Ri(t,o.from);return a.text=function(e,t){var n=Ei(e.doc.lineAt(t.from)),r=si(e,t).split("\n");return r.map((function(e){return e.startsWith(n)?e.slice(n.length):e}))}(t,o),n(t.update({effects:[bo.of({abbreviation:"",range:o,options:a,context:i})]})),!0}return!1},ko=r.e.fromClass(function(){function e(){b(this,e),M(this,"widget",null),M(this,"input",null)}return w(e,[{key:"update",value:function(e){var t=e.state,n=e.view,r=t.field(Oo);r?(this.widget||this.createInputPanel(n),this.updateAbbreviation(r.abbreviation)):this.widget&&(this.disposeWidget(),n.focus())}},{key:"createInputPanel",value:function(e){var t=document.createElement("div");t.className="emmet-wrap-with-abbreviation";var n=document.createElement("div");n.className="emmet-wrap-with-abbreviation__content";var r=document.createElement("input");r.placeholder="Enter abbreviation";var i=!1,o=function(){i&&(Object(c.n)(e),i=!1)};r.addEventListener("input",(function(){var t=e.state.field(Oo);if(t){var n=r.value;o();var a=I(Q({},t),{abbreviation:n});if(a.abbreviation){i=!0;var s=a.range,u=s.from,c=s.to,l=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],i="",o=null,a=0,s=0;s0&&void 0!==arguments[0]?arguments[0]:"Ctrl-w";return[Oo,ko,wo,r.q.of([{key:e,run:xo}])]}function _o(e,t){return e.from=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function d(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1)return null;if(r.type.isTop)break}return t(n)}}var _=b((function e(t,n,r,i){g(this,e),this.completion=t,this.source=n,this.match=r,this.score=i}));function P(e){return e.selection.main.from}function E(e,t){var n,r=e.source,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?new RegExp("".concat(i?"^":"","(?:").concat(r,")").concat(o?"$":""),null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}var T=r.a.define();var j=new WeakMap;function C(e){if(!Array.isArray(e))return e;var t=j.get(e);return t||j.set(e,t=k(e)),t}var A=r.n.define(),R=r.n.define(),$=function(){function e(t){g(this,e),this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(var n=0;n=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(T=Object(r.x)(E))!=T.toLowerCase()?1:T!=T.toUpperCase()?2:0;(!S||1==j&&x||0==P&&0!=j)&&(t[g]==E||n[g]==E&&(y=!0)?a[g++]=S:a.length&&(k=!1)),P=j,S+=Object(r.s)(E)}return g==f&&0==a[0]&&k?this.result((y?-200:0)-100,a,e):b==f&&0==O?this.ret(-200-e.length+(w==e.length?0:-100),[0,w]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):b==f?this.ret(-900-e.length,[O,w]):g==f?this.result((y?-200:0)-100-700+(k?0:-1100),a,e):2==t.length?null:this.result((i[0]?-700:0)-200-1100,i,e)}},{key:"result",value:function(e,t,n){var i,o=[],a=0,s=p(t);try{for(s.s();!(i=s.n()).done;){var u=i.value,c=u+(this.astral?Object(r.s)(Object(r.r)(n,u)):1);a&&o[a-1]==u?o[a-1]=c:(o[a++]=u,o[a++]=c)}}catch(e){s.e(e)}finally{s.f()}return this.ret(e-n.length,o)}}]),e}(),Q=function(){function e(t){g(this,e),this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}return b(e,[{key:"match",value:function(e){if(e.length=v||g>t.top?s=n.bottom-t.top:(h="bottom",s=t.bottom-n.top)}var y=(t.bottom-t.top)/a.offsetHeight,b=(t.right-t.left)/a.offsetWidth;return{style:"".concat(h,": ").concat(s/y,"px; max-width: ").concat(u/b,"px"),class:"cm-completionInfo-"+(f?c?"left-narrow":"right-narrow":l?"left":"right")}}function N(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){var r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}var i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var F=function(){function e(t,n,r){var i=this;g(this,e),this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:function(){return i.measureInfo()},write:function(e){return i.placeInfo(e)},key:this},this.space=null,this.currentClass="";var o=t.state.field(n),a=o.open,s=a.options,u=a.selected,c=t.state.facet(I);this.optionContent=function(e){var t=e.addToOptions.slice();return e.icons&&t.push({render:function(e){var t,n=document.createElement("div");return n.classList.add("cm-completionIcon"),e.type&&(t=n.classList).add.apply(t,f(e.type.split(/\s+/g).map((function(e){return"cm-completionIcon-"+e})))),n.setAttribute("aria-hidden","true"),n},position:20}),t.push({render:function(e,t,n,r){var i=document.createElement("span");i.className="cm-completionLabel";for(var o=e.displayLabel||e.label,a=0,s=0;sa&&i.appendChild(document.createTextNode(o.slice(a,u)));var l=i.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(o.slice(u,c))),l.className="cm-completionMatchedText",a=c}return a-1&&n.selected=this.range.to)&&(this.range=N(n.options.length,n.selected,this.view.state.facet(I).maxRenderedOptions),this.showOptions(n.options,t.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();var r=n.options[n.selected].completion,o=r.info;if(!o)return;var a="string"==typeof o?document.createTextNode(o):o(r);if(!a)return;"then"in a?a.then((function(n){n&&e.view.state.field(e.stateField,!1)==t&&e.addInfoPane(n,r)})).catch((function(t){return Object(i.s)(e.view.state,t,"completion info")})):this.addInfoPane(a,r)}}},{key:"addInfoPane",value:function(e,t){this.destroyInfo();var n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{var r=e.dom,i=e.destroy;n.appendChild(r),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}},{key:"updateSelectedOption",value:function(e){for(var t=null,n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)"LI"==n.nodeName&&n.id?r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):r--;return t&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.topn.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}(this.list,t),t}},{key:"measureInfo",value:function(){var e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;var t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){var o=this.dom.ownerDocument.defaultView||window;i={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottomn.from||0==n.from))if(i=l,"string"!=typeof c&&c.header)r.appendChild(c.header(c));else r.appendChild(document.createElement("completion-section")).textContent=l}var f=r.appendChild(document.createElement("li"));f.id=t+"-"+o,f.setAttribute("role","option");var h=this.optionClass(s);h&&(f.className=h);var d,m=p(this.optionContent);try{for(m.s();!(d=m.n()).done;){var v=(0,d.value)(s,this.view.state,this.view,u);v&&f.appendChild(v)}}catch(e){m.e(e)}finally{m.f()}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to=this.options.length?this:new e(this.options,V(n,t),this.tooltip,this.timestamp,t,this.disabled)}},{key:"map",value:function(t){return new e(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}},{key:"setDisabled",value:function(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}],[{key:"build",value:function(t,n,r,i,o,a){if(i&&!a&&t.some((function(e){return 1==e.state})))return i.setDisabled();var s=function(e,t){var n,r=[],i=null,o=function(e){r.push(e);var t=e.completion.section;if(t){i||(i=[]);var n="string"==typeof t?t:t.name;i.some((function(e){return e.name==n}))||i.push("string"==typeof t?{name:n}:t)}},a=t.facet(I),s=p(e);try{for(s.s();!(n=s.n()).done;){var u=n.value;if(u.hasResult()){var c=u.result.getMatch;if(!1===u.result.filter){var l,f=p(u.result.options);try{for(f.s();!(l=f.n()).done;){var h=l.value;o(new _(h,u.source,c?c(h):[],1e9-r.length))}}catch(e){f.e(e)}finally{f.f()}}else{var d,m=t.sliceDoc(u.from,u.to),v=void 0,g=a.filterStrict?new Q(m):new $(m),y=p(u.result.options);try{for(y.s();!(d=y.n()).done;){var b=d.value;if(v=g.match(b.label)){var O=b.displayLabel?c?c(b,v.matched):[]:v.matched;o(new _(b,u.source,O,v.score+(b.boost||0)))}}}catch(e){y.e(e)}finally{y.f()}}}}}catch(e){s.e(e)}finally{s.f()}if(i){var w,x=Object.create(null),k=0,S=p(i.sort((function(e,t){var n,r;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(r=t.rank)&&void 0!==r?r:1e9)||(e.nameq(M)&&(R[R.length-1]=F),M=F.completion}}catch(e){N.e(e)}finally{N.f()}return R}(t,n);if(!s.length)return i&&t.some((function(e){return 1==e.state}))?i.setDisabled():null;var u=n.facet(I).selectOnOpen?0:-1;if(i&&i.selected!=u&&-1!=i.selected)for(var c=i.options[i.selected].completion,l=0;l-1&&(n["aria-activedescendant"]=e+"-"+t),n}var W=[];function X(e,t){if(e.isUserEvent("input.complete")){var n=e.annotation(T);if(n&&t.activateOnCompletion(n))return 12}var r=e.isUserEvent("input.type");return r&&t.activateOnTyping?5:r?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}var Y=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;g(this,e),this.source=t,this.state=n,this.explicitPos=r}return b(e,[{key:"hasResult",value:function(){return!1}},{key:"update",value:function(t,n){var r=X(t,n),i=this;(8&r||16&r&&this.touches(t))&&(i=new e(i.source,0)),4&r&&0==i.state&&(i=new e(this.source,1)),i=i.updateFor(t,r);var o,a=p(t.effects);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.is(A))i=new e(i.source,1,s.value?P(t.state):-1);else if(s.is(R))i=new e(i.source,0);else if(s.is(H)){var u,c=p(s.value);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.source==i.source&&(i=l)}}catch(e){c.e(e)}finally{c.f()}}}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"updateFor",value:function(e,t){return this.map(e.changes)}},{key:"map",value:function(t){return t.empty||this.explicitPos<0?this:new e(this.source,this.state,t.mapPos(this.explicitPos))}},{key:"touches",value:function(e){return e.changes.touchesRange(P(e.state))}}]),e}(),G=function(e){function t(e,n,r,i,o){var s;return g(this,t),(s=a(this,t,[e,2,n])).result=r,s.from=i,s.to=o,s}return c(t,e),b(t,[{key:"hasResult",value:function(){return!0}},{key:"updateFor",value:function(e,n){var r;if(!(3&n))return this.map(e.changes);var i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));var o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),s=P(e.state);if((this.explicitPos<0?s<=o:sa||!i||2&n&&P(e.startState)==this.from)return new Y(this.source,4&n?1:0);var u=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,r){if(!e)return!1;var i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):E(e,!0).test(i)}(i.validFor,e.state,o,a)?new t(this.source,u,i,o,a):i.update&&(i=i.update(i,o,a,new w(e.state,s,u>=0)))?new t(this.source,u,i,i.from,null!==(r=i.to)&&void 0!==r?r:P(e.state)):new Y(this.source,1,u)}},{key:"map",value:function(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new t(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Y(this.source,0)}},{key:"touches",value:function(e){return e.changes.touchesRange(this.from,this.to)}}]),t}(Y);var H=r.n.define({map:function(e,t){return e.map((function(e){return e.map(t)}))}}),K=r.n.define(),J=r.o.define({create:function(){return U.start()},update:function(e,t){return e.update(t)},provide:function(e){return[i.x.from(e,(function(e){return e.tooltip})),i.c.contentAttributes.from(e,(function(e){return e.attrs}))]}});function ee(e,t){var n,i,o,a,s,u,c,l=t.completion.apply||t.completion.label,f=e.state.field(J).active.find((function(e){return e.source==t.source}));return f instanceof G&&("string"==typeof l?e.dispatch(Object.assign(Object.assign({},(n=e.state,i=l,o=f.from,a=f.to,s=n.selection.main,u=o-s.from,c=a-s.from,Object.assign(Object.assign({},n.changeByRange((function(e){if(e!=s&&o!=a&&n.sliceDoc(e.from+u,e.from+c)!=n.sliceDoc(o,a))return{range:e};var t=n.toText(i);return{changes:{from:e.from+u,to:a==s.from?e.to:e.from+c,insert:t},range:r.f.cursor(e.from+u+t.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"}))),{annotations:T.of(t.completion)})):l(e,t.completion,f.from,f.to),!0)}var te=L(J,ee);function ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(J,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+a*(e?1:-1):e?0:s-1;return u<0?u="page"==t?0:s-1:u>=s&&(u="page"==t?s-1:0),n.dispatch({effects:K.of(u)}),!0}}var re=function(e){var t=e.state.field(J,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp50&&Date.now()-s.time>1e3){var u,c=p(s.context.abortListeners);try{for(c.s();!(u=c.n()).done;){var l=u.value;try{l()}catch(e){Object(i.s)(this.view.state,e)}}}catch(e){c.e(e)}finally{c.f()}s.context.abortListeners=null,this.running.splice(a--,1)}else{var h;(h=s.updates).push.apply(h,f(e.transactions))}}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some((function(e){return e.effects.some((function(e){return e.is(A)}))}))&&(this.pendingStart=!0);var d=this.pendingStart?50:r.activateOnTypingDelay;if(this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.active.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),d):-1,0!=this.composing){var m,v=p(e.transactions);try{for(v.s();!(m=v.n()).done;){var g=m.value;g.isUserEvent("input.type")?this.composing=2:2==this.composing&&g.selection&&(this.composing=3)}}catch(e){v.e(e)}finally{v.f()}}}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1,this.pendingStart=!1;var t,n=this.view.state.field(J),r=p(n.active);try{var i=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.active.source==n.source}))||e.startQuery(n)};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}this.running.length&&n.open&&n.open.disabled&&(this.debounceAccept=setTimeout((function(){return e.accept()}),this.view.state.facet(I).updateSyncTime))}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=P(n),o=new w(n,r,e.explicitPos==r,this.view),a=new oe(e,o);this.running.push(a),Promise.resolve(e.source(o)).then((function(e){a.context.aborted||(a.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:R.of(null)}),Object(i.s)(t.view.state,e)}))}},{key:"scheduleAccept",value:function(){var e=this;this.running.every((function(e){return void 0!==e.done}))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((function(){return e.accept()}),this.view.state.facet(I).updateSyncTime))}},{key:"accept",value:function(){var e,t=this;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;for(var n=[],r=this.view.state.facet(I),i=this.view.state.field(J),o=function(o){var s=t.running[o];if(void 0===s.done)return a=o,0;if(t.running.splice(o--,1),s.done){var u,c=new G(s.active.source,s.active.explicitPos,s.done,s.done.from,null!==(e=s.done.to)&&void 0!==e?e:P(s.updates.length?s.updates[0].startState:t.view.state)),l=p(s.updates);try{for(l.s();!(u=l.n()).done;){var f=u.value;c=c.update(f,r)}}catch(e){l.e(e)}finally{l.f()}if(c.hasResult())return n.push(c),a=o,0}var h=i.active.find((function(e){return e.source==s.active.source}));if(h&&1==h.state)if(null==s.done){var d,m=new Y(s.active.source,0),v=p(s.updates);try{for(v.s();!(d=v.n()).done;){var g=d.value;m=m.update(g,r)}}catch(e){v.e(e)}finally{v.f()}1!=m.state&&n.push(m)}else t.startQuery(h);a=o},a=0;a1||e.ctrlKey&&(!se||!e.altKey)||e.metaKey)return!1;var r=n.open.options[n.open.selected],i=n.active.find((function(e){return e.source==r.source})),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&ee(t,r),!1}})),ce=i.c.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"".concat(400,"px"),boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"".concat(30,"px")},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"".concat(30,"px")},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),le=b((function e(t,n,r,i){g(this,e),this.field=t,this.line=n,this.from=r,this.to=i})),fe=function(){function e(t,n,r){g(this,e),this.field=t,this.from=n,this.to=r}return b(e,[{key:"map",value:function(t){var n=t.mapPos(this.from,-1,r.i.TrackDel),i=t.mapPos(this.to,1,r.i.TrackDel);return null==n||null==i?null:new e(this.field,n,i)}}]),e}(),he=function(){function e(t,n){g(this,e),this.lines=t,this.fieldPositions=n}return b(e,[{key:"instantiate",value:function(e,t){var n,r=[],i=[t],a=e.doc.lineAt(t),s=/^\s*/.exec(a.text)[0],u=p(this.lines);try{for(u.s();!(n=u.n()).done;){var c=n.value;if(r.length){for(var l=s,f=/^\t*/.exec(c)[0].length,h=0;h=f&&y.field++}}catch(e){g.e(e)}finally{g.f()}}a.push(new le(f,o.length,n.index,n.index+h.length)),u=u.slice(0,n.index)+l+u.slice(n.index+n[0].length)}u=u.replace(/\\([{}])/g,(function(e,t,n){var r,i=p(a);try{for(i.s();!(r=i.n()).done;){var s=r.value;s.line==o.length&&s.from>n&&(s.from--,s.to--)}}catch(e){i.e(e)}finally{i.f()}return t})),o.push(u)}}catch(e){s.e(e)}finally{s.f()}return new e(o,a)}}]),e}(),pe=i.a.widget({widget:new(function(e){function t(){return g(this,t),a(this,t,arguments)}return c(t,e),b(t,[{key:"toDOM",value:function(){var e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}},{key:"ignoreEvent",value:function(){return!1}}]),t}(i.f))}),de=i.a.mark({class:"cm-snippetField"}),me=function(){function e(t,n){g(this,e),this.ranges=t,this.active=n,this.deco=i.a.set(t.map((function(e){return(e.from==e.to?pe:de).range(e.from,e.to)})))}return b(e,[{key:"map",value:function(t){var n,r=[],i=p(this.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value.map(t);if(!o)return null;r.push(o)}}catch(e){i.e(e)}finally{i.f()}return new e(r,this.active)}},{key:"selectionInsideField",value:function(e){var t=this;return e.ranges.every((function(e){return t.ranges.some((function(n){return n.field==t.active&&n.from<=e.from&&n.to>=e.to}))}))}}]),e}(),ve=r.n.define({map:function(e,t){return e&&e.map(t)}}),ge=r.n.define(),ye=r.o.define({create:function(){return null},update:function(e,t){var n,r=p(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(ve))return i.value;if(i.is(ge)&&e)return new me(e.ranges,i.value)}}catch(e){r.e(e)}finally{r.f()}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:function(e){return i.c.decorations.from(e,(function(e){return e?e.deco:i.a.none}))}});function be(e,t){return r.f.create(e.filter((function(e){return e.field==t})).map((function(e){return r.f.range(e.from,e.to)})))}function Oe(e){var t=he.parse(e);return function(e,n,i,o){var a=t.instantiate(e.state,i),s=a.text,u=a.ranges,c={changes:{from:i,to:o,insert:r.p.of(s)},scrollIntoView:!0,annotations:n?[T.of(n),r.q.userEvent.of("input.complete")]:void 0};if(u.length&&(c.selection=be(u,0)),u.some((function(e){return e.field>0}))){var l=new me(u,0),f=c.effects=[ve.of(l)];void 0===e.state.field(ye,!1)&&f.push(r.n.appendConfig.of([ye,Se,Pe,ce]))}e.dispatch(e.state.update(c))}}function we(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(ye,!1);if(!i||e<0&&0==i.active)return!1;var o=i.active+e,a=e>0&&!i.ranges.some((function(t){return t.field==o+e}));return r(n.update({selection:be(i.ranges,o),effects:ve.of(a?null:new me(i.ranges,o)),scrollIntoView:!0})),!0}}var xe=[{key:"Tab",run:we(1),shift:we(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(ye,!1)&&(n(t.update({effects:ve.of(null)})),!0)}}],ke=r.h.define({combine:function(e){return e.length?e[0]:xe}}),Se=r.j.highest(i.q.compute([ke],(function(e){return e.facet(ke)})));function _e(e,t){return Object.assign(Object.assign({},t),{apply:Oe(e)})}var Pe=i.c.domEventHandlers({mousedown:function(e,t){var n,r=t.state.field(ye,!1);if(!r||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;var i=r.ranges.find((function(e){return e.from<=n&&e.to>=n}));return!(!i||i.field==r.active)&&(t.dispatch({selection:be(r.ranges,i.field),effects:ve.of(r.ranges.some((function(e){return e.field>i.field}))?new me(r.ranges,i.field):null),scrollIntoView:!0}),!0)}});var Ee={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Te=r.n.define({map:function(e,t){var n=t.mapPos(e,-1,r.i.TrackAfter);return null==n?void 0:n}}),je=new(function(e){function t(){return g(this,t),a(this,t,arguments)}return c(t,e),b(t)}(r.m));je.startSide=1,je.endSide=-1;var Ce=r.o.define({create:function(){return r.k.empty},update:function(e,t){if(e=e.map(t.changes),t.selection){var n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:function(e){return e>=n.from&&e<=n.to}})}var r,i=p(t.effects);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.is(Te)&&(e=e.update({add:[je.range(o.value,o.value+1)]}))}}catch(e){i.e(e)}finally{i.f()}return e}});function Ae(){return[Me,Ce]}var Re="()[]{}<>";function $e(e){for(var t=0;t2||2==i.length&&1==Object(r.s)(Object(r.r)(i,0))||t!=o.from||n!=o.to)return!1;var a=function(e,t){var n,i=Qe(e,e.selection.main.head),o=i.brackets||Ee.brackets,a=p(o);try{for(a.s();!(n=a.n()).done;){var s=n.value,u=$e(Object(r.r)(s,0));if(t==s)return u==s?ze(e,s,o.indexOf(s+s+s)>-1,i):Le(e,s,u,i.before||Ee.before);if(t==u&&Ne(e,e.selection.main.from))return qe(e,s,u)}}catch(e){a.e(e)}finally{a.f()}return null}(e.state,i);return!!a&&(e.dispatch(a),!0)})),De=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var i=Qe(t,t.selection.main.head).brackets||Ee.brackets,o=null,a=t.changeByRange((function(e){if(e.empty){var n,a=(c=t.doc,l=e.head,f=c.sliceString(l-2,l),Object(r.s)(Object(r.r)(f,0))==f.length?f:f.slice(1)),s=p(i);try{for(s.s();!(n=s.n()).done;){var u=n.value;if(u==a&&Fe(t.doc,e.head)==$e(Object(r.r)(u,0)))return{changes:{from:e.head-u.length,to:e.head+u.length},range:r.f.cursor(e.head-u.length)}}}catch(e){s.e(e)}finally{s.f()}}var c,l,f;return{range:o=e}}));return o||n(t.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!o}}];function Ne(e,t){var n=!1;return e.field(Ce).between(0,e.doc.length,(function(e){e==t&&(n=!0)})),n}function Fe(e,t){var n=e.sliceString(t,t+2);return n.slice(0,Object(r.s)(Object(r.r)(n,0)))}function Le(e,t,n,i){var o=null,a=e.changeByRange((function(a){if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:Te.of(a.to+t.length),range:r.f.range(a.anchor+t.length,a.head+t.length)};var s=Fe(e.doc,a.head);return!s||/\s/.test(s)||i.indexOf(s)>-1?{changes:{insert:t+n,from:a.head},effects:Te.of(a.head+t.length),range:r.f.cursor(a.head+t.length)}:{range:o=a}}));return o?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function qe(e,t,n){var i=null,o=e.changeByRange((function(t){return t.empty&&Fe(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:r.f.cursor(t.head+n.length)}:i={range:t}}));return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ze(e,t,n,i){var a=i.stringPrefixes||Ee.stringPrefixes,s=null,u=e.changeByRange((function(i){if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:Te.of(i.to+t.length),range:r.f.range(i.anchor+t.length,i.head+t.length)};var u,c=i.head,l=Fe(e.doc,c);if(l==t){if(Ue(e,c))return{changes:{insert:t+t,from:c},effects:Te.of(c+t.length),range:r.f.cursor(c+t.length)};if(Ne(e,c)){var f=n&&e.sliceDoc(c,c+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+f.length,insert:f},range:r.f.cursor(c+f.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(u=Be(e,c-2*t.length,a))>-1&&Ue(e,u))return{changes:{insert:t+t+t+t,from:c},effects:Te.of(c+t.length),range:r.f.cursor(c+t.length)};if(e.charCategorizer(c)(l)!=r.d.Word&&Be(e,c,a)>-1&&!function(e,t,n,r){for(var i=Object(o.I)(e).resolveInner(t,-1),a=r.reduce((function(e,t){return Math.max(e,t.length)}),0),s=0;s<5;s++){var u=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),c=u.indexOf(n);if(!c||c>-1&&r.indexOf(u.slice(0,c))>-1){for(var l=i.firstChild;l&&l.from==i.from&&l.to-l.from>n.length+c;){if(e.sliceDoc(l.to-n.length,l.to)==n)return!1;l=l.firstChild}return!0}var f=i.to==t&&i.parent;if(!f)break;i=f}return!1}(e,c,t,a))return{changes:{insert:t+t,from:c},effects:Te.of(c+t.length),range:r.f.cursor(c+t.length)}}return{range:s=i}}));return s?null:e.update(u,{scrollIntoView:!0,userEvent:"input.type"})}function Ue(e,t){var n=Object(o.I)(e).resolveInner(t+1);return n.parent&&n.from==t}function Be(e,t,n){var i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=r.d.Word)return t;var o,a=p(n);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=t-s.length;if(e.sliceDoc(u,t)==s&&i(e.sliceDoc(u-1,u))!=r.d.Word)return u}}catch(e){a.e(e)}finally{a.f()}return-1}function Ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[ue,J,I.of(e),ae,We,ce]}var Ve=[{key:"Ctrl-Space",run:ie},{mac:"Alt-`",run:ie},{key:"Escape",run:function(e){var t=e.state.field(J,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:R.of(null)}),!0)}},{key:"ArrowDown",run:ne(!0)},{key:"ArrowUp",run:ne(!1)},{key:"PageDown",run:ne(!0,"page")},{key:"PageUp",run:ne(!1,"page")},{key:"Enter",run:re}],We=r.j.highest(i.q.computeN([I],(function(e){return e.facet(I).defaultKeymap?[Ve]:[]})));function Xe(e){var t=e.field(J,!1);return t&&t.active.some((function(e){return 1==e.state}))?"pending":t&&t.active.some((function(e){return 0!=e.state}))?"active":null}function Ye(e){var t,n=null===(t=e.field(J,!1))||void 0===t?void 0:t.open;return n&&!n.disabled&&n.selected>=0?n.options[n.selected].completion:null}},482:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i}));var r=n(69);n(213),n(57),n(65);n(92);new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");n(487);function i(e){const{spanId:t,traceId:n}=e.spanContext(),{data:i,op:a,parent_span_id:s,status:u,tags:c,origin:l}=o(e);return Object(r.c)({data:i,op:a,parent_span_id:s,span_id:t,status:u,tags:c,trace_id:n,origin:l})}function o(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function a(e){const{traceFlags:t}=e.spanContext();return Boolean(1&t)}},487:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(37);function i(){return Date.now()/1e3}const o=function(){const{performance:e}=r.a;if(!e||!e.now)return i;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();let a;(()=>{const{performance:e}=r.a;if(!e||!e.now)return void(a="none");const t=36e5,n=e.now(),i=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,s=o=0;--o){var a=i[o],s=!isNaN(+a)?[]:{};s[a]=t,t=s}n=r.merge(n,t)})),n}},490:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="production"},491:function(e,t,n){"use strict";var r=n(0),i=["second","minute","hour","day","week","month","year"],o=["秒","分钟","小时","天","周","个月","年"],a={},s=function(e,t){a[e]=t},u=function(e){return a[e]||a.en_US},c=[60,60,24,7,365/7/12,12];function l(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}function f(e,t){for(var n=e<0?1:0,r=e=Math.abs(e),i=0;e>=c[i]&&i(0===(i*=2)?9:1)&&(i+=1),t(e,i,r)[n].replace("%s",e.toString())}function h(e,t){return(+(t?l(t):new Date)-+l(e))/1e3}var p="timeago-id";function d(e){return parseInt(e.getAttribute(p))}var m={},v=function(e){clearTimeout(e),delete m[e]};function g(e,t,n,r){v(d(e));var i=r.relativeDate,o=r.minInterval,a=h(t,i);e.innerText=f(a,n);var s=setTimeout((function(){g(e,t,n,r)}),Math.min(1e3*Math.max(function(e){for(var t=1,n=0,r=Math.abs(e);e>=c[n]&&n1&&(n+="s"),[e+" "+n+" ago","in "+e+" "+n]})),s("zh_CN",(function(e,t){if(0===t)return["刚刚","片刻后"];var n=o[~~(t/2)];return[e+" "+n+"前",e+" "+n+"后"]}));var b,O=(b=function(e,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},b(e,t)},function(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),w=function(){return w=Object.assign||function(e){for(var t,n=1,r=arguments.length;n[]))}function c(e){u().push(e)}function l(e,t,n,r=0){return new i.a(((i,u)=>{const c=e[r];if(null===t||"function"!=typeof c)i(t);else{const f=c({...t},n);s.a&&c.id&&null===f&&o.c.log(`Event processor "${c.id}" dropped event`),Object(a.o)(f)?f.then((t=>l(e,t,n,r+1).then(i))).then(null,u):l(e,f,n,r+1).then(i).then(null,u)}}))}},497:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(57),i=n(903),o=n(69),a=n(813);function s(e,t=100,n=1/0){try{return c("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function u(e,t=3,n=102400){const r=s(e,t);return i=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(i))>n?u(e,t-1,n):r;var i}function c(t,n,s=1/0,u=1/0,l=Object(i.a)()){const[f,h]=l;if(null==n||["number","boolean","string"].includes(typeof n)&&!Object(r.h)(n))return n;const p=function(t,n){try{if("domain"===t&&n&&"object"==typeof n&&n._events)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if(void 0!==e&&n===e)return"[Global]";if("undefined"!=typeof window&&n===window)return"[Window]";if("undefined"!=typeof document&&n===document)return"[Document]";if(Object(r.p)(n))return"[VueViewModel]";if(Object(r.n)(n))return"[SyntheticEvent]";if("number"==typeof n&&n!=n)return"[NaN]";if("function"==typeof n)return`[Function: ${Object(a.b)(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const i=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(n);return/^HTML(\w*)Element$/.test(i)?`[HTMLElement: ${i}]`:`[object ${i}]`}catch(e){return`**non-serializable** (${e})`}}(t,n);if(!p.startsWith("[object "))return p;if(n.__sentry_skip_normalization__)return n;const d="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:s;if(0===d)return p.replace("object ","");if(f(n))return"[Circular ~]";const m=n;if(m&&"function"==typeof m.toJSON)try{return c("",m.toJSON(),d-1,u,l)}catch(e){}const v=Array.isArray(n)?[]:{};let g=0;const y=Object(o.b)(n);for(const e in y){if(!Object.prototype.hasOwnProperty.call(y,e))continue;if(g>=u){v[e]="[MaxProperties ~]";break}const t=y[e];v[e]=c(e,t,d-1,u,l),g++}return h(n),v}}).call(this,n(239))},5:function(e,t,n){"use strict";n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return y})),n.d(t,"e",(function(){return M}));var r=n(27);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1?e:d.get(e.base||e,e.modified.concat(t).sort((function(e,t){return e.id-t.id})))}}}]),e}(),p=0,d=function(){function e(t){s(this,e),this.name=t,this.instances=[],this.id=p++}return c(e,null,[{key:"get",value:function(t,n){if(!n.length)return t;var r=n[0].instances.find((function(e){return e.base==t&&(r=n,i=e.modified,r.length==i.length&&r.every((function(e,t){return e==i[t]})));var r,i}));if(r)return r;var i,a=[],s=new h(t.name,a,t,n),u=o(n);try{for(u.s();!(i=u.n()).done;){i.value.instances.push(s)}}catch(e){u.e(e)}finally{u.f()}var c,l=function(e){for(var t=[[]],n=0;n0&&f+3==s.length){c=1;break}var h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+s);if(u.push("*"==h[0]?"":'"'==h[0][0]?JSON.parse(h[0]):h[0]),(f+=h[0].length)==s.length)break;var p=s[f++];if(f==s.length&&"!"==p){c=0;break}if("/"!=p)throw new RangeError("Invalid path: "+s);l=s.slice(f)}var d=u.length-1,m=u[d];if(!m)throw new RangeError("Invalid path: "+s);var y=new g(r,c,d>0?u.slice(0,d):null);t[m]=y.sort(t[m])}}}catch(e){a.e(e)}finally{a.f()}}return v.add(t)}var v=new r.c,g=function(){function e(t,n,r,i){s(this,e),this.tags=t,this.mode=n,this.context=r,this.next=i}return c(e,[{key:"opaque",get:function(){return 0==this.mode}},{key:"inherit",get:function(){return 1==this.mode}},{key:"sort",value:function(e){return!e||e.depth3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.length,o=new O(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}g.empty=new g([],2,null);var O=function(){function e(t,n,r){s(this,e),this.at=t,this.highlighters=n,this.span=r,this.class=""}return c(e,[{key:"startSpan",value:function(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}},{key:"flush",value:function(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}},{key:"highlightRange",value:function(e,t,n,i,a){var s=e.type,u=e.from,c=e.to;if(!(u>=n||c<=t)){s.isTop&&(a=this.highlighters.filter((function(e){return!e.scope||e.scope(s)})));var l=i,f=function(e){var t=e.type.prop(v);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||g.empty,h=function(e,t){var n,r=null,i=o(e);try{for(i.s();!(n=i.n()).done;){var a=n.value.style(t);a&&(r=r?r+" "+a:a)}}catch(e){i.e(e)}finally{i.f()}return r}(a,f.tags);if(h&&(l&&(l+=" "),l+=h,1==f.mode&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(t,u),l),!f.opaque){var p=e.tree&&e.tree.prop(r.c.mounted);if(p&&p.overlay){for(var d=e.node.enter(p.overlay[0].from+u,1),m=this.highlighters.filter((function(e){return!e.scope||e.scope(p.tree.type)})),y=e.firstChild(),b=0,O=u;;b++){var w=b=x)&&e.nextSibling()););if(!w||x>n)break;(O=w.to+u)>t&&(this.highlightRange(d.cursor(),Math.max(t,w.from+u),Math.min(n,O),"",m),this.startSpan(Math.min(n,O),l))}y&&e.parent()}else if(e.firstChild()){p&&(i="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,a),this.startSpan(Math.min(n,e.to),l)}}while(e.nextSibling());e.parent()}}}}}]),e}();var w=h.define,x=w(),k=w(),S=w(k),_=w(k),P=w(),E=w(P),T=w(P),j=w(),C=w(j),A=w(),R=w(),$=w(),Q=w($),I=w(),M={comment:x,lineComment:w(x),blockComment:w(x),docComment:w(x),name:k,variableName:w(k),typeName:S,tagName:w(S),propertyName:_,attributeName:w(_),className:w(k),labelName:w(k),namespace:w(k),macroName:w(k),literal:P,string:E,docString:w(E),character:w(E),attributeValue:w(E),number:T,integer:w(T),float:w(T),bool:w(P),regexp:w(P),escape:w(P),color:w(P),url:w(P),keyword:A,self:w(A),null:w(A),atom:w(A),unit:w(A),modifier:w(A),operatorKeyword:w(A),controlKeyword:w(A),definitionKeyword:w(A),moduleKeyword:w(A),operator:R,derefOperator:w(R),arithmeticOperator:w(R),logicOperator:w(R),bitwiseOperator:w(R),compareOperator:w(R),updateOperator:w(R),definitionOperator:w(R),typeOperator:w(R),controlOperator:w(R),punctuation:$,separator:w($),bracket:Q,angleBracket:w(Q),squareBracket:w(Q),paren:w(Q),brace:w(Q),content:j,heading:C,heading1:w(C),heading2:w(C),heading3:w(C),heading4:w(C),heading5:w(C),heading6:w(C),contentSeparator:w(j),list:w(j),quote:w(j),emphasis:w(j),strong:w(j),link:w(j),monospace:w(j),strikethrough:w(j),inserted:w(),deleted:w(),changed:w(),invalid:w(),meta:I,documentMeta:w(I),annotation:w(I),processingInstruction:w(I),definition:h.defineModifier("definition"),constant:h.defineModifier("constant"),function:h.defineModifier("function"),standard:h.defineModifier("standard"),local:h.defineModifier("local"),special:h.defineModifier("special")};for(var D in M){var N=M[D];N instanceof h&&(N.name=D)}y([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}])},50:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},501:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return c}));var r=n(10),i=n(151),o=Object.prototype.hasOwnProperty;function a(){for(var e=[],t=0;t1)for(var r=new c,i=1;i0){if(e!==s){e=s,t.forEach((function(e){a(e).dep.dirty(r),l(e)}));var u=Array.from(n);n.clear(),u.forEach((function(t){return t(e)}))}}else{var c=i.getValue();c&&(o(c),a(c).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var o=r.attachCache=function(e){return t.add(e),a(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function l(e){e.broadcastWatches&&e.broadcastWatches()}},567:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return h}));var r=n(57),i=n(487),o=n(92),a=n(65),s=n(493),u=n(219),c=n(585);let l;class f{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=p()}static clone(e){return e?e.clone():new f}clone(){const e=new f;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Object(u.c)(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof f?t:this}return e instanceof f?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Object(r.j)(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=p(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:Object(i.a)(),...e},o=this._breadcrumbs;return o.push(r),this._breadcrumbs=o.length>n?o.slice(-n):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:i,_user:o,_level:a,_fingerprint:s,_eventProcessors:u,_propagationContext:c,_sdkProcessingMetadata:l,_transactionName:f,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:i,user:o,level:a,fingerprint:s||[],eventProcessors:u,propagationContext:c,sdkProcessingMetadata:l,transactionName:f,span:h}}applyToEvent(e,t={},n=[]){Object(c.a)(e,this.getScopeData());const r=[...n,...Object(s.b)(),...this._eventProcessors];return Object(s.c)(r,e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Object(o.f)();if(!this._client)return a.c.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Object(o.f)();if(!this._client)return a.c.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Object(o.f)();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(a.c.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function h(){return l||(l=new f),l}function p(){return{traceId:Object(o.f)(),spanId:Object(o.f)().substring(16)}}},57:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return p})),n.d(t,"g",(function(){return b})),n.d(t,"h",(function(){return y})),n.d(t,"i",(function(){return l})),n.d(t,"j",(function(){return h})),n.d(t,"k",(function(){return f})),n.d(t,"l",(function(){return m})),n.d(t,"m",(function(){return c})),n.d(t,"n",(function(){return g})),n.d(t,"o",(function(){return v})),n.d(t,"p",(function(){return O}));const r=Object.prototype.toString;function i(e){switch(r.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return b(e,Error)}}function o(e,t){return r.call(e)===`[object ${t}]`}function a(e){return o(e,"ErrorEvent")}function s(e){return o(e,"DOMError")}function u(e){return o(e,"DOMException")}function c(e){return o(e,"String")}function l(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function f(e){return null===e||l(e)||"object"!=typeof e&&"function"!=typeof e}function h(e){return o(e,"Object")}function p(e){return"undefined"!=typeof Event&&b(e,Event)}function d(e){return"undefined"!=typeof Element&&b(e,Element)}function m(e){return o(e,"RegExp")}function v(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function g(e){return h(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function y(e){return"number"==typeof e&&e!=e}function b(e,t){try{return e instanceof t}catch(e){return!1}}function O(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}},571:function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[f]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var i=p(t,f);if(i){var o=i.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return m(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(u("iterator")&&(i=p(t,l)))return new n((function(e){g((function(){if(!e.closed){for(var n,o=r(i.call(t));!(n=o()).done;){var a=n.value;if(e.next(a),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){g((function(){if(!e.closed){for(var n=0;n"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||r,o=e=>{let t=i(e),n=t.data;return t.data="",n},a=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,s=/\/\*[^]*?\*\/| +/g,u=/\n+/g,c=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+a+";":r+="f"==o[1]?c(a,o):o+"{"+c(a,"k"==o[1]?"":t)+"}":"object"==typeof a?r+=c(a,t?t.replace(/([^,])+/g,(e=>o.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):o):null!=a&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=c.p?c.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},l={},f=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+f(e[n]);return t}return e},h=(e,t,n,r,i)=>{let o=f(e),h=l[o]||(l[o]=(e=>{let t=0,n=11;for(;t>>0;return"go"+n})(o));if(!l[h]){let t=o!==e?e:(e=>{let t,n,r=[{}];for(;t=a.exec(e.replace(s,""));)t[4]?r.shift():t[3]?(n=t[3].replace(u," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(u," ").trim();return r[0]})(e);l[h]=c(i?{["@keyframes "+h]:t}:t,n?"":"."+h)}let p=n&&l.g?l.g:null;return n&&(l.g=l[h]),((e,t,n,r)=>{r?t.data=t.data.replace(r,e):-1===t.data.indexOf(e)&&(t.data=n?e+t.data:t.data+e)})(l[h],t,r,p),h},p=(e,t,n)=>e.reduce(((e,r,i)=>{let o=t[i];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":c(e,""):!1===e?"":e}return e+r+(null==o?"":o)}),"");function d(e){let t=this||{},n=e.call?e(t.p):e;return h(n.unshift?n.raw?p(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,i(t.target),t.g,t.o,t.k)}let m,v,g,y=d.bind({g:1}),b=d.bind({k:1});function O(e,t,n,r){c.p=t,m=e,v=n,g=r}function w(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),u=s.className||i.className;n.p=Object.assign({theme:v&&v()},s),n.o=/ *go\d+/.test(u),s.className=d.apply(n,r)+(u?" "+u:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),g&&c[0]&&g(s),m(c,s)}return t?t(i):i}}},575:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:String(t)}function o(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t")}},577:function(e,t,n){"use strict";function r(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}n.d(t,"a",(function(){return r}))},578:function(e,t,n){"use strict";var r=n(75);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},579:function(e,t,n){(function(t){var n;n=()=>{var e,n={},r={exports:n},i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,h=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&h(e,n,t[n]);if(c)for(var n of c(t))f.call(t,n)&&h(e,n,t[n]);return e},d=(e,t)=>o(e,s(t)),m=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},v={};m(v,{ErrorInfo:()=>_,Realtime:()=>Zn,Rest:()=>Wt,default:()=>zr,msgpack:()=>Fr,protocolMessageFromDeserialized:()=>on}),r.exports=(e=v,((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of u(t))l.call(e,o)||o===n||i(e,o,{get:()=>t[o],enumerable:!(r=a(t,o))||r.enumerable});return e})(i({},"__esModule",{value:!0}),e));var g=class{},y=void 0!==t?t:"undefined"!=typeof window?window:self;function b(e,t){return`${e}`.padStart(t?3:2,"0")}function O(e){return g.Config.logTimestamps?function(t){const n=new Date;e(b(n.getHours())+":"+b(n.getMinutes())+":"+b(n.getSeconds())+"."+b(n.getMilliseconds(),1)+" "+t)}:function(t){e(t)}}var w=class e{constructor(){this.deprecated=(e,t)=>{this.deprecationWarning(`${e} is deprecated and will be removed in a future version. ${t}`)},this.shouldLog=e=>e<=this.logLevel,this.setLog=(e,t)=>{void 0!==e&&(this.logLevel=e),void 0!==t&&(this.logHandler=this.logErrorHandler=t)},this.logLevel=e.defaultLogLevel,this.logHandler=e.defaultLogHandler,this.logErrorHandler=e.defaultLogErrorHandler}static initLogHandlers(){const[t,n]=(()=>{var e;let t,n;return"function"==typeof(null==(e=null==y?void 0:y.console)?void 0:e.log)?(t=function(...e){console.log.apply(console,e)},n=console.warn?function(...e){console.warn.apply(console,e)}:t):t=n=function(){},[t,n].map(O)})();this.defaultLogHandler=t,this.defaultLogErrorHandler=n,this.defaultLogger=new e}static logActionNoStrip(e,t,n,r){e.logAction(t,n,r)}logAction(e,t,n){this.shouldLog(e)&&(1===e?this.logErrorHandler:this.logHandler)("Ably: "+t+": "+n,e)}renamedClientOption(e,t){this.deprecationWarning(`The \`${e}\` client option has been renamed to \`${t}\`. Please update your code to use \`${t}\` instead. \`${e}\` will be removed in a future version.`)}renamedMethod(e,t,n){this.deprecationWarning(`\`${e}\`’s \`${t}\` method has been renamed to \`${n}\`. Please update your code to use \`${n}\` instead. \`${t}\` will be removed in a future version.`)}deprecationWarning(e){this.shouldLog(1)&&this.logErrorHandler(`Ably: Deprecation warning - ${e}`,1)}};w.defaultLogLevel=1,w.LOG_NONE=0,w.LOG_ERROR=1,w.LOG_MAJOR=2,w.LOG_MINOR=3,w.LOG_MICRO=4,w.logAction=(e,t,n,r)=>{w.logActionNoStrip(e,t,n,r)};var x=w,k={};function S(e){let t="["+e.constructor.name;return e.message&&(t+=": "+e.message),e.statusCode&&(t+="; statusCode="+e.statusCode),e.code&&(t+="; code="+e.code),e.cause&&(t+="; cause="+K(e.cause)),!e.href||e.message&&e.message.indexOf("help.ably.io")>-1||(t+="; see "+e.href+" "),t+="]",t}m(k,{Format:()=>W,allSame:()=>V,allToLowerCase:()=>se,allToUpperCase:()=>ue,arrChooseN:()=>re,arrDeleteValue:()=>q,arrEquals:()=>ve,arrIntersect:()=>N,arrIntersectOb:()=>F,arrPopRandomElement:()=>X,arrSubtract:()=>L,arrWithoutValue:()=>z,cheapRandStr:()=>te,containsValue:()=>M,copy:()=>T,createMissingPluginError:()=>ge,dataSizeBytes:()=>ee,decodeBody:()=>oe,encodeBody:()=>ae,ensureArray:()=>j,forInOwnNonNullProperties:()=>Z,getBackoffCoefficient:()=>ce,getGlobalObject:()=>he,getJitterCoefficient:()=>le,getRetryTime:()=>fe,inherits:()=>I,inspectBody:()=>J,inspectError:()=>K,intersect:()=>D,isEmpty:()=>A,isErrorInfoOrPartialErrorInfo:()=>H,isNil:()=>R,isObject:()=>C,keysArray:()=>U,matchDerivedChannel:()=>de,mixin:()=>E,parseQueryString:()=>G,prototypicalClone:()=>Q,randomString:()=>ne,shallowClone:()=>$,shallowEquals:()=>pe,throwMissingPluginError:()=>ye,toBase64:()=>me,toQueryString:()=>Y,valuesArray:()=>B,whenPromiseSettles:()=>ie,withTimeoutAsync:()=>be});var _=class e extends Error{constructor(t,n,r,i){super(t),void 0!==Object.setPrototypeOf&&Object.setPrototypeOf(this,e.prototype),this.code=n,this.statusCode=r,this.cause=i}toString(){return S(this)}static fromValues(t){const{message:n,code:r,statusCode:i}=t;if("string"!=typeof n||"number"!=typeof r||"number"!=typeof i)throw new Error("ErrorInfo.fromValues(): invalid values: "+g.Config.inspect(t));const o=Object.assign(new e(n,r,i),t);return o.code&&!o.href&&(o.href="https://help.ably.io/error/"+o.code),o}},P=class e extends Error{constructor(t,n,r,i){super(t),void 0!==Object.setPrototypeOf&&Object.setPrototypeOf(this,e.prototype),this.code=n,this.statusCode=r,this.cause=i}toString(){return S(this)}static fromValues(t){const{message:n,code:r,statusCode:i}=t;if("string"!=typeof n||!R(r)&&"number"!=typeof r||!R(i)&&"number"!=typeof i)throw new Error("PartialErrorInfo.fromValues(): invalid values: "+g.Config.inspect(t));const o=Object.assign(new e(n,r,i),t);return o.code&&!o.href&&(o.href="https://help.ably.io/error/"+o.code),o}};function E(e,...t){for(let n=0;n(e.msgpack="msgpack",e.json="json",e))(W||{});function X(e){return e.splice((t=e,Math.floor(Math.random()*t.length)),1)[0];var t}function Y(e){const t=[];if(e)for(const n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.length?"?"+t.join("&"):""}function G(e){let t;const n=/([^?&=]+)=?([^&]*)/g,r={};for(;t=n.exec(e);)r[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return r}function H(e){return"object"==typeof e&&null!==e&&(e instanceof _||e instanceof P)}function K(e){var t,n;return e instanceof Error||"ErrorInfo"===(null==(t=null==e?void 0:e.constructor)?void 0:t.name)||"PartialErrorInfo"===(null==(n=null==e?void 0:e.constructor)?void 0:n.name)?e.toString():g.Config.inspect(e)}function J(e){return g.BufferUtils.isBuffer(e)?e.toString():"string"==typeof e?e:g.Config.inspect(e)}function ee(e){if(g.BufferUtils.isBuffer(e))return g.BufferUtils.byteLength(e);if("string"==typeof e)return g.Config.stringByteSize(e);throw new Error("Expected input of Utils.dataSizeBytes to be a buffer or string, but was: "+typeof e)}function te(){return String(Math.random()).substr(2)}var ne=async e=>{const t=await g.Config.getRandomArrayBuffer(e);return g.BufferUtils.base64Encode(t)};function re(e,t){const n=Math.min(t,e.length),r=e.slice(),i=[];for(let e=0;e{null==t||t(null,e)})).catch((e=>{null==t||t(e)}))}function oe(e,t,n){return"msgpack"==n?(t||ye("MsgPack"),t.decode(e)):JSON.parse(String(e))}function ae(e,t,n){return"msgpack"==n?(t||ye("MsgPack"),t.encode(e,!0)):JSON.stringify(e)}function se(e){return e.map((function(e){return e&&e.toLowerCase()}))}function ue(e){return e.map((function(e){return e&&e.toUpperCase()}))}function ce(e){return Math.min((e+2)/3,2)}function le(){return 1-.2*Math.random()}function fe(e,t){return e*ce(t)*le()}function he(){return void 0!==t?t:"undefined"!=typeof window?window:self}function pe(e,t){return Object.keys(e).every((n=>e[n]===t[n]))&&Object.keys(t).every((n=>t[n]===e[n]))}function de(e){const t=e.match(/^(\[([^?]*)(?:(.*))\])?(.+)$/);if(!t||!t.length||t.length<5)throw new _("regex match failed",400,40010);if(t[2])throw new _(`cannot use a derived option with a ${t[2]} channel`,400,40010);return{qualifierParam:t[3]||"",channelName:t[4]}}function me(e){const t=g.BufferUtils,n=t.utf8Encode(e);return t.base64Encode(n)}function ve(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))}function ge(e){return new _(`${e} plugin not provided`,40019,400)}function ye(e){throw ge(e)}async function be(e,t=5e3,n="Timeout expired"){const r=new _(n,5e4,500);return Promise.race([e,new Promise(((e,n)=>setTimeout((()=>n(r)),t)))])}var Oe="2.6.0",we={ENVIRONMENT:"",REST_HOST:"rest.ably.io",REALTIME_HOST:"realtime.ably.io",FALLBACK_HOSTS:["A.ably-realtime.com","B.ably-realtime.com","C.ably-realtime.com","D.ably-realtime.com","E.ably-realtime.com"],PORT:80,TLS_PORT:443,TIMEOUTS:{disconnectedRetryTimeout:15e3,suspendedRetryTimeout:3e4,httpRequestTimeout:1e4,httpMaxRetryDuration:15e3,channelRetryTimeout:15e3,fallbackRetryTimeout:6e5,connectionStateTtl:12e4,realtimeRequestTimeout:1e4,recvTimeout:9e4,webSocketConnectTimeout:1e4,webSocketSlowTimeout:4e3},httpMaxRetryCount:3,maxMessageSize:65536,version:Oe,protocolVersion:3,agent:"ably-js/"+Oe,getHost:xe,getPort:function(e,t){return t||e.tls?e.tlsPort:e.port},getHttpScheme:function(e){return e.tls?"https://":"http://"},environmentFallbackHosts:ke,getFallbackHosts:Se,getHosts:function(e,t){const n=[e.restHost].concat(Se(e));return t?n.map((t=>xe(e,t,!0))):n},checkHost:_e,objectifyOptions:function(e,t,n,r,i){if(void 0===e){const e=t?`${n} must be initialized with either a client options object, an Ably API key, or an Ably Token`:`${n} must be initialized with a client options object`;throw x.logAction(r,x.LOG_ERROR,`${n}()`,e),new Error(e)}let o;if("string"==typeof e)if(-1==e.indexOf(":")){if(!t){const e=`${n} cannot be initialized with just an Ably Token; you must provide a client options object with a \`plugins\` property. (Set this Ably Token as the object’s \`token\` property.)`;throw x.logAction(r,x.LOG_ERROR,`${n}()`,e),new Error(e)}o={token:e}}else{if(!t){const e=`${n} cannot be initialized with just an Ably API key; you must provide a client options object with a \`plugins\` property. (Set this Ably API key as the object’s \`key\` property.)`;throw x.logAction(r,x.LOG_ERROR,`${n}()`,e),new Error(e)}o={key:e}}else o=e;return i&&(o=d(p({},o),{plugins:p(p({},i),o.plugins)})),o},normaliseOptions:function(e,t,n){const r=null!=n?n:x.defaultLogger;"function"==typeof e.recover&&!0===e.closeOnUnload&&(x.logAction(r,x.LOG_ERROR,"Defaults.normaliseOptions","closeOnUnload was true and a session recovery function was set - these are mutually exclusive, so unsetting the latter"),e.recover=void 0),"closeOnUnload"in e||(e.closeOnUnload=!e.recover),"queueMessages"in e||(e.queueMessages=!0);const i=e.environment&&String(e.environment).toLowerCase()||we.ENVIRONMENT,o=!i||"production"===i;e.fallbackHosts||e.restHost||e.realtimeHost||e.port||e.tlsPort||(e.fallbackHosts=o?we.FALLBACK_HOSTS:ke(i));const a=e.restHost||(o?we.REST_HOST:i+"-"+we.REST_HOST),s=function(e,t,n,r){return e.realtimeHost?e.realtimeHost:e.restHost?(x.logAction(r,x.LOG_MINOR,"Defaults.normaliseOptions",'restHost is set to "'+e.restHost+'" but realtimeHost is not set, so setting realtimeHost to "'+e.restHost+'" too. If this is not what you want, please set realtimeHost explicitly.'),e.restHost):t?we.REALTIME_HOST:n+"-"+we.REALTIME_HOST}(e,o,i,r);(e.fallbackHosts||[]).concat(a,s).forEach(_e),e.port=e.port||we.PORT,e.tlsPort=e.tlsPort||we.TLS_PORT,"tls"in e||(e.tls=!0);const u=function(e){const t={};for(const n in we.TIMEOUTS)t[n]=e[n]||we.TIMEOUTS[n];return t}(e);e.useBinaryProtocol=!!t&&("useBinaryProtocol"in e?g.Config.supportsBinary&&e.useBinaryProtocol:g.Config.preferBinary);const c={};e.clientId&&(c["X-Ably-ClientId"]=g.BufferUtils.base64Encode(g.BufferUtils.utf8Encode(e.clientId))),"idempotentRestPublishing"in e||(e.idempotentRestPublishing=!0);let l=null,f=e.connectivityCheckUrl;if(e.connectivityCheckUrl){let[t,n]=e.connectivityCheckUrl.split("?");l=n?G(n):{},-1===t.indexOf("://")&&(t="https://"+t),f=t}let h=e.wsConnectivityCheckUrl;return h&&-1===h.indexOf("://")&&(h="wss://"+h),d(p({},e),{realtimeHost:s,restHost:a,maxMessageSize:e.maxMessageSize||we.maxMessageSize,timeouts:u,connectivityCheckParams:l,connectivityCheckUrl:f,wsConnectivityCheckUrl:h,headers:c})},defaultGetHeaders:function(e,{format:t=je,protocolVersion:n=Ce}={}){return{accept:Te[t],"X-Ably-Version":n.toString(),"Ably-Agent":Pe(e)}},defaultPostHeaders:function(e,{format:t=je,protocolVersion:n=Ce}={}){let r;return{accept:r=Te[t],"content-type":r,"X-Ably-Version":n.toString(),"Ably-Agent":Pe(e)}}};function xe(e,t,n){return t=n?t==e.restHost&&e.realtimeHost||t||e.realtimeHost:t||e.restHost}function ke(e){return[e+"-a-fallback.ably-realtime.com",e+"-b-fallback.ably-realtime.com",e+"-c-fallback.ably-realtime.com",e+"-d-fallback.ably-realtime.com",e+"-e-fallback.ably-realtime.com"]}function Se(e){const t=e.fallbackHosts,n=void 0!==e.httpMaxRetryCount?e.httpMaxRetryCount:we.httpMaxRetryCount;return t?re(t,n):[]}function _e(e){if("string"!=typeof e)throw new _("host must be a string; was a "+typeof e,4e4,400);if(!e.length)throw new _("host must not be zero-length",4e4,400)}function Pe(e){let t=we.agent;if(e.agents)for(var n in e.agents)t+=" "+n+"/"+e.agents[n];return t}function Ee(e,t,n){const r=n||{};if(r.cipher){e||ye("Crypto");const n=e.getCipher(r.cipher,t);r.cipher=n.cipherParams,r.channelCipher=n.cipher}else"cipher"in r&&(r.cipher=void 0,r.channelCipher=null);return r}var Te={json:"application/json",xml:"application/xml",html:"text/html",msgpack:"application/x-msgpack",text:"text/plain"},je="json",Ce=we.protocolVersion,Ae=we,Re=class e{constructor(e,t){this.logger=e,this.members=t||[]}call(e,t){for(const n of this.members)if(n)try{n(e,t)}catch(e){x.logAction(this.logger,x.LOG_ERROR,"Multicaster multiple callback handler","Unexpected exception: "+e+"; stack = "+e.stack)}}push(...e){this.members.push(...e)}createPromise(){return new Promise(((e,t)=>{this.push(((n,r)=>{n?t(n):e(r)}))}))}resolveAll(e){this.call(null,e)}rejectAll(e){this.call(e)}static create(t,n){const r=new e(t,n);return Object.assign(((e,t)=>r.call(e,t)),{push:e=>r.push(e),createPromise:()=>r.createPromise(),resolveAll:e=>r.resolveAll(e),rejectAll:e=>r.rejectAll(e)})}},$e=(e=>(e.Get="get",e.Delete="delete",e.Post="post",e.Put="put",e.Patch="patch",e))($e||{}),Qe=$e,Ie=(e=>(e[e.Success=200]="Success",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.RequestTimeout=408]="RequestTimeout",e[e.InternalServerError=500]="InternalServerError",e))(Ie||{}),Me=Ie,De=Math.pow(2,17);function Ne(e){return H(e)?(e.code||(403===e.statusCode?e.code=40300:(e.code=40170,e.statusCode=401)),e):new _(K(e),e.code||40170,e.statusCode||401)}function Fe(e){if(!e)return"";"string"==typeof e&&(e=JSON.parse(e));const t=Object.create(null),n=U(e,!0);if(!n)return"";n.sort();for(let r=0;r{this.client.connection.connectionManager.onAuthUpdated(n,((n,r)=>n?t(n):e(r)))})):n}catch(e){throw this.client.connection&&e.statusCode===Me.Forbidden&&this.client.connection.connectionManager.actOnErrorFromAuthorize(e),e}}async _forceNewToken(e,t){this.tokenDetails=null,this._saveTokenOptions(e,t),Le(this.authOptions,this.logger);try{return this._ensureValidAuthCredentials(!0)}finally{delete this.tokenParams.timestamp,delete this.authOptions.queryTime}}async requestToken(e,t){const n=t||this.authOptions,r=e||T(this.tokenParams);let i,o=this.client;if(n.authCallback)x.logAction(this.logger,x.LOG_MINOR,"Auth.requestToken()","using token auth with authCallback"),i=n.authCallback;else if(n.authUrl)x.logAction(this.logger,x.LOG_MINOR,"Auth.requestToken()","using token auth with authUrl"),i=(e,t)=>{const r=E({accept:"application/json, text/plain"},n.authHeaders),i=n.authMethod&&"post"===n.authMethod.toLowerCase();let o;const a=n.authUrl.indexOf("?");a>-1&&(o=G(n.authUrl.slice(a)),n.authUrl=n.authUrl.slice(0,a),i||(n.authParams=E(o,n.authParams)));const s=E({},n.authParams||{},e),u=e=>{var n,r;let i=null!=(n=e.body)?n:null,o=null;if(e.error)x.logAction(this.logger,x.LOG_MICRO,"Auth.requestToken().tokenRequestCallback","Received Error: "+K(e.error));else{const t=null!=(r=e.headers["content-type"])?r:null;o=Array.isArray(t)?t.join(", "):t,x.logAction(this.logger,x.LOG_MICRO,"Auth.requestToken().tokenRequestCallback","Received; content-type: "+o+"; body: "+J(i))}if(e.error)return void t(e.error,null);if(e.unpacked)return void t(null,i);if(g.BufferUtils.isBuffer(i)&&(i=i.toString()),!o)return void t(new _("authUrl response is missing a content-type header",40170,401),null);const a=o.indexOf("application/json")>-1,s=o.indexOf("text/plain")>-1||o.indexOf("application/jwt")>-1;if(a||s){if(a){if(i.length>De)return void t(new _("authUrl response exceeded max permitted length",40170,401),null);try{i=JSON.parse(i)}catch(e){return void t(new _("Unexpected error processing authURL response; err = "+e.message,40170,401),null)}}t(null,i,o)}else t(new _("authUrl responded with unacceptable content-type "+o+", should be either text/plain, application/jwt or application/json",40170,401),null)};if(x.logAction(this.logger,x.LOG_MICRO,"Auth.requestToken().tokenRequestCallback","Requesting token from "+n.authUrl+"; Params: "+JSON.stringify(s)+"; method: "+(i?"POST":"GET")),i){const e=r||{};e["content-type"]="application/x-www-form-urlencoded";const t=Y(s).slice(1);ie(this.client.http.doUri(Qe.Post,n.authUrl,e,t,o),((e,t)=>u(e||t)))}else ie(this.client.http.doUri(Qe.Get,n.authUrl,r||{},null,s),((e,t)=>u(e||t)))};else{if(!n.key){const e="Need a new token, but authOptions does not include any way to request one (no authUrl, authCallback, or key)";throw x.logAction(this.logger,x.LOG_ERROR,"Auth()","library initialized with a token literal without any way to renew the token when it expires (no authUrl, authCallback, or key). See https://help.ably.io/error/40171 for help"),new _(e,40171,403)}x.logAction(this.logger,x.LOG_MINOR,"Auth.requestToken()","using token auth with client-side signing"),i=(e,t)=>{ie(this.createTokenRequest(e,n),((e,n)=>t(e,null!=n?n:null)))}}"capability"in r&&(r.capability=Fe(r.capability));const a=(e,t)=>{const r="/keys/"+e.keyName+"/requestToken",i=Ae.defaultPostHeaders(this.client.options);n.requestHeaders&&E(i,n.requestHeaders),x.logAction(this.logger,x.LOG_MICRO,"Auth.requestToken().requestToken","Sending POST to "+r+"; Token params: "+JSON.stringify(e)),ie(this.client.http.do(Qe.Post,(function(e){return o.baseUri(e)+r}),i,JSON.stringify(e),null),((e,n)=>e?t(e):t(n.error,n.body,n.unpacked)))};return new Promise(((e,t)=>{let o=!1,s=this.client.options.timeouts.realtimeRequestTimeout,u=setTimeout((()=>{o=!0;const e="Token request callback timed out after "+s/1e3+" seconds";x.logAction(this.logger,x.LOG_ERROR,"Auth.requestToken()",e),t(new _(e,40170,401))}),s);i(r,((r,i,s)=>{if(o)return;if(clearTimeout(u),r)return x.logAction(this.logger,x.LOG_ERROR,"Auth.requestToken()","token request signing call returned error; err = "+K(r)),void t(Ne(r));if("string"==typeof i)return void(0===i.length?t(new _("Token string is empty",40170,401)):i.length>De?t(new _("Token string exceeded max permitted length (was "+i.length+" bytes)",40170,401)):"undefined"===i||"null"===i?t(new _("Token string was literal null/undefined",40170,401)):"{"!==i[0]||s&&s.indexOf("application/jwt")>-1?e({token:i}):t(new _("Token was double-encoded; make sure you're not JSON-encoding an already encoded token request or details",40170,401)));if("object"!=typeof i||null===i){const e="Expected token request callback to call back with a token string or token request/details object, but got a "+typeof i;return x.logAction(this.logger,x.LOG_ERROR,"Auth.requestToken()",e),void t(new _(e,40170,401))}const c=JSON.stringify(i).length;if(c>De&&!n.suppressMaxLengthCheck)t(new _("Token request/details object exceeded max permitted stringified size (was "+c+" bytes)",40170,401));else if("issued"in i)e(i);else{if(!("keyName"in i)){const e="Expected token request callback to call back with a token string, token request object, or token details object";return x.logAction(this.logger,x.LOG_ERROR,"Auth.requestToken()",e),void t(new _(e,40170,401))}a(i,((n,r,i)=>{if(n)return x.logAction(this.logger,x.LOG_ERROR,"Auth.requestToken()","token request API call returned error; err = "+K(n)),void t(Ne(n));i||(r=JSON.parse(r)),x.logAction(this.logger,x.LOG_MINOR,"Auth.getToken()","token received"),e(r)}))}}))}))}async createTokenRequest(e,t){t=t||this.authOptions,e=e||T(this.tokenParams);const n=t.key;if(!n)throw new _("No key specified",40101,403);const r=n.split(":"),i=r[0],o=r[1];if(!o)throw new _("Invalid key specified",40101,403);if(""===e.clientId)throw new _("clientId can’t be an empty string",40012,400);"capability"in e&&(e.capability=Fe(e.capability));const a=E({keyName:i},e),s=e.clientId||"",u=e.ttl||"",c=e.capability||"";a.timestamp||(a.timestamp=await this.getTimestamp(t&&t.queryTime));const l=a.nonce||(a.nonce=("000000"+Math.floor(1e16*Math.random())).slice(-16)),f=a.timestamp,h=a.keyName+"\n"+u+"\n"+c+"\n"+s+"\n"+f+"\n"+l+"\n";return a.mac=a.mac||((e,t)=>{const n=g.BufferUtils,r=n.utf8Encode(e),i=n.utf8Encode(t),o=n.hmacSha256(r,i);return n.base64Encode(o)})(h,o),x.logAction(this.logger,x.LOG_MINOR,"Auth.getTokenRequest()","generated signed request"),a}async getAuthParams(){if("basic"==this.method)return{key:this.key};{let e=await this._ensureValidAuthCredentials(!1);if(!e)throw new Error("Auth.getAuthParams(): _ensureValidAuthCredentials returned no error or tokenDetails");return{access_token:e.token}}}async getAuthHeaders(){if("basic"==this.method)return{authorization:"Basic "+this.basicKey};{const e=await this._ensureValidAuthCredentials(!1);if(!e)throw new Error("Auth.getAuthParams(): _ensureValidAuthCredentials returned no error or tokenDetails");return{authorization:"Bearer "+me(e.token)}}}async getTimestamp(e){return this.isTimeOffsetSet()||!e&&!this.authOptions.queryTime?this.getTimestampUsingOffset():this.client.time()}getTimestampUsingOffset(){return Date.now()+(this.client.serverTimeOffset||0)}isTimeOffsetSet(){return null!==this.client.serverTimeOffset}_saveBasicOptions(e){this.method="basic",this.key=e.key,this.basicKey=me(e.key),this.authOptions=e||{},"clientId"in e&&this._userSetClientId(e.clientId)}_saveTokenOptions(e,t){this.method="token",e&&(this.tokenParams=e),t&&(t.token&&(t.tokenDetails="string"==typeof t.token?{token:t.token}:t.token),t.tokenDetails&&(this.tokenDetails=t.tokenDetails),"clientId"in t&&this._userSetClientId(t.clientId),this.authOptions=t)}async _ensureValidAuthCredentials(e){const t=this.tokenDetails;if(t){if(this._tokenClientIdMismatch(t.clientId))throw new _("Mismatch between clientId in token ("+t.clientId+") and current clientId ("+this.clientId+")",40102,403);if(!this.isTimeOffsetSet()||!t.expires||t.expires>=this.getTimestampUsingOffset())return x.logAction(this.logger,x.LOG_MINOR,"Auth.getToken()","using cached token; expires = "+t.expires),t;x.logAction(this.logger,x.LOG_MINOR,"Auth.getToken()","deleting expired token"),this.tokenDetails=null}const n=(this.waitingForTokenRequest||(this.waitingForTokenRequest=Re.create(this.logger))).createPromise();if(null!==this.currentTokenRequestId&&!e)return n;const r=this.currentTokenRequestId=ze++;let i,o=null;try{i=await this.requestToken(this.tokenParams,this.authOptions)}catch(e){o=e}if(this.currentTokenRequestId>r)return x.logAction(this.logger,x.LOG_MINOR,"Auth._ensureValidAuthCredentials()","Discarding token request response; overtaken by newer one"),n;this.currentTokenRequestId=null;const a=this.waitingForTokenRequest;return this.waitingForTokenRequest=null,o?(null==a||a.rejectAll(o),n):(null==a||a.resolveAll(this.tokenDetails=i),n)}_userSetClientId(e){if("string"!=typeof e&&null!==e)throw new _("clientId must be either a string or null",40012,400);if("*"===e)throw new _('Can’t use "*" as a clientId as that string is reserved. (To change the default token request behaviour to use a wildcard clientId, instantiate the library with {defaultTokenParams: {clientId: "*"}}), or if calling authorize(), pass it in as a tokenParam: authorize({clientId: "*"}, authOptions)',40012,400);{const t=this._uncheckedSetClientId(e);if(t)throw t}}_uncheckedSetClientId(e){if(this._tokenClientIdMismatch(e)){const t="Unexpected clientId mismatch: client has "+this.clientId+", requested "+e,n=new _(t,40102,401);return x.logAction(this.logger,x.LOG_ERROR,"Auth._uncheckedSetClientId()",t),n}return this.clientId=this.tokenParams.clientId=e,null}_tokenClientIdMismatch(e){return!(!this.clientId||"*"===this.clientId||!e||"*"===e||this.clientId===e)}static isTokenErr(e){return e.code&&e.code>=40140&&e.code<40150}revokeTokens(e,t){return this.client.rest.revokeTokens(e,t)}};function Be(e){const t=[];if(e)for(const n in e)t.push(n+"="+e[n]);return t.join("&")}function Ze(e,t){return e+(t?"?":"")+Be(t)}var Ve=class{constructor(e){this.client=e,this.platformHttp=new g.Http(e),this.checkConnectivity=this.platformHttp.checkConnectivity?()=>this.platformHttp.checkConnectivity():void 0}get logger(){var e,t;return null!=(t=null==(e=this.client)?void 0:e.logger)?t:x.defaultLogger}get supportsAuthHeaders(){return this.platformHttp.supportsAuthHeaders}get supportsLinkHeaders(){return this.platformHttp.supportsLinkHeaders}_getHosts(e){const t=e.connection,n=t&&t.connectionManager.host;return n?[n].concat(Ae.getFallbackHosts(e.options)):Ae.getHosts(e.options)}async do(e,t,n,r,i){try{const o=this.client;if(!o)return{error:new _("http.do called without client",5e4,500)};const a="function"==typeof t?t:function(e){return o.baseUri(e)+t},s=o._currentFallback;if(s){if(s.validUntil>Date.now()){const u=await this.doUri(e,a(s.host),n,r,i);return u.error&&this.platformHttp.shouldFallback(u.error)?(o._currentFallback=null,this.do(e,t,n,r,i)):u}o._currentFallback=null}const u=this._getHosts(o);if(1===u.length)return this.doUri(e,a(u[0]),n,r,i);let c=null;const l=async(t,s)=>{const u=t.shift();c=null!=c?c:new Date;const f=await this.doUri(e,a(u),n,r,i);return f.error&&this.platformHttp.shouldFallback(f.error)&&t.length?Date.now()-c.getTime()>o.options.timeouts.httpMaxRetryDuration?{error:new _(`Timeout for trying fallback hosts retries. Total elapsed time exceeded the ${o.options.timeouts.httpMaxRetryDuration}ms limit`,50003,500)}:l(t,!0):(s&&(o._currentFallback={host:u,validUntil:Date.now()+o.options.timeouts.fallbackRetryTimeout}),f)};return l(u)}catch(e){return{error:new _(`Unexpected error in Http.do: ${K(e)}`,500,5e4)}}}async doUri(e,t,n,r,i){try{!function(e,t,n,r,i){i.shouldLog(x.LOG_MICRO)&&x.logActionNoStrip(i,x.LOG_MICRO,"Http."+e+"()","Sending; "+Ze(t,r)+"; Body"+(g.BufferUtils.isBuffer(n)?" (Base64): "+g.BufferUtils.base64Encode(n):": "+n))}(e,t,r,i,this.logger);const o=await this.platformHttp.doUri(e,t,n,r,i);return this.logger.shouldLog(x.LOG_MICRO)&&function(e,t,n,r,i){e.error?x.logActionNoStrip(i,x.LOG_MICRO,"Http."+t+"()","Received Error; "+Ze(n,r)+"; Error: "+K(e.error)):x.logActionNoStrip(i,x.LOG_MICRO,"Http."+t+"()","Received; "+Ze(n,r)+"; Headers: "+Be(e.headers)+"; StatusCode: "+e.statusCode+"; Body"+(g.BufferUtils.isBuffer(e.body)?" (Base64): "+g.BufferUtils.base64Encode(e.body):": "+e.body))}(o,e,t,i,this.logger),o}catch(e){return{error:new _(`Unexpected error in Http.doUri: ${K(e)}`,500,5e4)}}}},We=class{constructor(e){var t,n,r,i,o,a,s,u;this.Platform=g,this.ErrorInfo=_,this.Logger=x,this.Defaults=Ae,this.Utils=k,this._additionalHTTPRequestImplementations=null!=(t=e.plugins)?t:null,this.logger=new x,this.logger.setLog(e.logLevel,e.logHandler),x.logAction(this.logger,x.LOG_MICRO,"BaseClient()","initialized with clientOptions "+g.Config.inspect(e)),this._MsgPack=null!=(r=null==(n=e.plugins)?void 0:n.MsgPack)?r:null;const c=this.options=Ae.normaliseOptions(e,this._MsgPack,this.logger);if(c.key){const e=c.key.match(/^([^:\s]+):([^:.\s]+)$/);if(!e){const e="invalid key parameter";throw x.logAction(this.logger,x.LOG_ERROR,"BaseClient()",e),new _(e,40400,404)}c.keyName=e[1],c.keySecret=e[2]}if("clientId"in c){if("string"!=typeof c.clientId&&null!==c.clientId)throw new _("clientId must be either a string or null",40012,400);if("*"===c.clientId)throw new _('Can’t use "*" as a clientId as that string is reserved. (To change the default token request behaviour to use a wildcard clientId, use {defaultTokenParams: {clientId: "*"}})',40012,400)}x.logAction(this.logger,x.LOG_MINOR,"BaseClient()","started; version = "+Ae.version),this._currentFallback=null,this.serverTimeOffset=null,this.http=new Ve(this),this.auth=new Ue(this,c),this._rest=(null==(i=e.plugins)?void 0:i.Rest)?new e.plugins.Rest(this):null,this._Crypto=null!=(a=null==(o=e.plugins)?void 0:o.Crypto)?a:null,this.__FilteredSubscriptions=null!=(u=null==(s=e.plugins)?void 0:s.MessageInteractions)?u:null}get rest(){return this._rest||ye("Rest"),this._rest}get _FilteredSubscriptions(){return this.__FilteredSubscriptions||ye("MessageInteractions"),this.__FilteredSubscriptions}get channels(){return this.rest.channels}get push(){return this.rest.push}get device(){var e;return(null==(e=this.options.plugins)?void 0:e.Push)&&this.push.LocalDevice||ye("Push"),this._device||(this._device=this.push.LocalDevice.load(this)),this._device}baseUri(e){return Ae.getHttpScheme(this.options)+e+":"+Ae.getPort(this.options,!1)}async stats(e){return this.rest.stats(e)}async time(e){return this.rest.time(e)}async request(e,t,n,r,i,o){return this.rest.request(e,t,n,r,i,o)}batchPublish(e){return this.rest.batchPublish(e)}batchPresence(e){return this.rest.batchPresence(e)}setLog(e){this.logger.setLog(e.level,e.handler)}};We.Platform=g;var Xe=We,Ye=class e{toJSON(){var e,t,n;return{id:this.id,deviceSecret:this.deviceSecret,platform:this.platform,formFactor:this.formFactor,clientId:this.clientId,metadata:this.metadata,deviceIdentityToken:this.deviceIdentityToken,push:{recipient:null==(e=this.push)?void 0:e.recipient,state:null==(t=this.push)?void 0:t.state,error:null==(n=this.push)?void 0:n.error}}}toString(){var e,t,n,r;let i="[DeviceDetails";return this.id&&(i+="; id="+this.id),this.platform&&(i+="; platform="+this.platform),this.formFactor&&(i+="; formFactor="+this.formFactor),this.clientId&&(i+="; clientId="+this.clientId),this.metadata&&(i+="; metadata="+this.metadata),this.deviceIdentityToken&&(i+="; deviceIdentityToken="+JSON.stringify(this.deviceIdentityToken)),(null==(e=this.push)?void 0:e.recipient)&&(i+="; push.recipient="+JSON.stringify(this.push.recipient)),(null==(t=this.push)?void 0:t.state)&&(i+="; push.state="+this.push.state),(null==(n=this.push)?void 0:n.error)&&(i+="; push.error="+JSON.stringify(this.push.error)),(null==(r=this.push)?void 0:r.metadata)&&(i+="; push.metadata="+this.push.metadata),i+="]",i}static toRequestBody(e,t,n){return ae(e,t,n)}static fromResponseBody(t,n,r){return r&&(t=oe(t,n,r)),Array.isArray(t)?e.fromValuesArray(t):e.fromValues(t)}static fromValues(t){return t.error=t.error&&_.fromValues(t.error),Object.assign(new e,t)}static fromLocalDevice(t){return Object.assign(new e,t)}static fromValuesArray(t){const n=t.length,r=new Array(n);for(let i=0;i0)try{t._MsgPack||ye("MsgPack"),i=t._MsgPack.decode(r)}catch(t){x.logAction(u,x.LOG_MICRO,"Resource."+e+"()","Sending MsgPack Decoding Error: "+K(t))}x.logAction(u,x.LOG_MICRO,"Resource."+e+"()","Sending; "+Ze(n,a)+"; Body: "+i)}const c=await t.http.do(e,n,o,r,a);return c.error&&Ue.isTokenErr(c.error)?(await t.auth.authorize(null,null),Ge(t,o,a,i)):{err:c.error,body:c.body,headers:c.headers,unpacked:c.unpacked,statusCode:c.statusCode}}));if(a&&(c=function(e,t,n){if(e.err&&!e.body)return{err:e.err};if(e.statusCode===Me.NoContent)return d(p({},e),{body:[],unpacked:!0});let r=e.body;if(!e.unpacked)try{r=oe(r,t,n)}catch(e){return H(e)?{err:e}:{err:new P(K(e),null)}}if(!r)return{err:new P("unenvelope(): Response body is missing",null)};const{statusCode:i,response:o,headers:a}=r;if(void 0===i)return d(p({},e),{body:r,unpacked:!0});if(i<200||i>=300){let t=o&&o.error||e.err;return t||(t=new Error("Error in unenveloping "+r),t.statusCode=i),{err:t,body:o,headers:a,unpacked:!0,statusCode:i}}return{err:e.err,body:o,headers:a,unpacked:!0,statusCode:i}}(c,t._MsgPack,a)),u.shouldLog(x.LOG_MICRO)&&function(e,t,n,r,i){e.err?x.logAction(i,x.LOG_MICRO,"Resource."+t+"()","Received Error; "+Ze(n,r)+"; Error: "+K(e.err)):x.logAction(i,x.LOG_MICRO,"Resource."+t+"()","Received; "+Ze(n,r)+"; Headers: "+Be(e.headers)+"; StatusCode: "+e.statusCode+"; Body: "+(g.BufferUtils.isBuffer(e.body)?" (Base64): "+g.BufferUtils.base64Encode(e.body):": "+g.Config.inspect(e.body)))}(c,e,n,o,u),s){if(c.err)throw c.err;{const e=p({},c);return delete e.err,e}}return c}};function Ke(e){const t=e.match(/^\.\/(\w+)\?(.*)$/);return t&&t[2]&&G(t[2])}var Je=class{constructor(e,t,n){this.resource=e,this.items=t;const r=this;n&&("first"in n&&(this.first=async function(){return r.get(n.first)}),"current"in n&&(this.current=async function(){return r.get(n.current)}),this.next=async function(){return"next"in n?r.get(n.next):null},this.hasNext=function(){return"next"in n},this.isLast=()=>{var e;return!(null==(e=this.hasNext)?void 0:e.call(this))})}async get(e){const t=this.resource,n=await He.get(t.client,t.path,t.headers,e,t.envelope,!1);return t.handlePage(n)}},et=class extends Je{constructor(e,t,n,r,i,o){super(e,t,i),this.statusCode=r,this.success=r<300&&r>=200,this.headers=n,this.errorCode=o&&o.code,this.errorMessage=o&&o.message}toJSON(){return{items:this.items,statusCode:this.statusCode,success:this.success,headers:this.headers,errorCode:this.errorCode,errorMessage:this.errorMessage}}},tt=class{constructor(e,t,n,r,i,o){this.client=e,this.path=t,this.headers=n,this.envelope=null!=r?r:null,this.bodyHandler=i,this.useHttpPaginatedResponse=o||!1}get logger(){return this.client.logger}async get(e){const t=await He.get(this.client,this.path,this.headers,e,this.envelope,!1);return this.handlePage(t)}async delete(e){const t=await He.delete(this.client,this.path,this.headers,e,this.envelope,!1);return this.handlePage(t)}async post(e,t){const n=await He.post(this.client,this.path,t,this.headers,e,this.envelope,!1);return this.handlePage(n)}async put(e,t){const n=await He.put(this.client,this.path,t,this.headers,e,this.envelope,!1);return this.handlePage(n)}async patch(e,t){const n=await He.patch(this.client,this.path,t,this.headers,e,this.envelope,!1);return this.handlePage(n)}async handlePage(e){if(e.err&&(t=e.err,n=e.body,!this.useHttpPaginatedResponse||!n&&"number"!=typeof t.code))throw x.logAction(this.logger,x.LOG_ERROR,"PaginatedResource.handlePage()","Unexpected error getting resource: err = "+K(e.err)),e.err;var t,n;let r,i,o;try{r=e.statusCode==Me.NoContent?[]:await this.bodyHandler(e.body,e.headers||{},e.unpacked)}catch(t){throw e.err||t}return e.headers&&(i=e.headers.Link||e.headers.link)&&(o=function(e){"string"==typeof e&&(e=e.split(","));const t={};for(let n=0;n;\s*rel="(\w+)"$/);if(r){const e=Ke(r[1]);e&&(t[r[2]]=e)}}return t}(i)),this.useHttpPaginatedResponse?new et(this,r,e.headers||{},e.statusCode,o,e.err):new Je(this,r,o)}},nt=class e{toJSON(){return{channel:this.channel,deviceId:this.deviceId,clientId:this.clientId}}toString(){let e="[PushChannelSubscription";return this.channel&&(e+="; channel="+this.channel),this.deviceId&&(e+="; deviceId="+this.deviceId),this.clientId&&(e+="; clientId="+this.clientId),e+="]",e}static fromResponseBody(t,n,r){return r&&(t=oe(t,n,r)),Array.isArray(t)?e.fromValuesArray(t):e.fromValues(t)}static fromValues(t){return Object.assign(new e,t)}static fromValuesArray(t){const n=t.length,r=new Array(n);for(let i=0;i{var i;(null==(i=this.client.options.plugins)?void 0:i.Push)?this.stateMachine?this.stateMachine.activatedCallback?r(new _("Activation already in progress",4e4,400)):(this.stateMachine.activatedCallback=e=>{e?r(e):n()},this.stateMachine.updateFailedCallback=t,this.stateMachine.handleEvent(new this.client.options.plugins.Push.CalledActivate(this.stateMachine,e))):r(new _("This platform is not supported as a target of push notifications",4e4,400)):r(ge("Push"))}))}async deactivate(e){await new Promise(((t,n)=>{var r;(null==(r=this.client.options.plugins)?void 0:r.Push)?this.stateMachine?this.stateMachine.deactivatedCallback?n(new _("Deactivation already in progress",4e4,400)):(this.stateMachine.deactivatedCallback=e=>{e?n(e):t()},this.stateMachine.handleEvent(new this.client.options.plugins.Push.CalledDeactivate(this.stateMachine,e))):n(new _("This platform is not supported as a target of push notifications",4e4,400)):n(ge("Push"))}))}},ut=["message.unset","message.create","message.update","message.delete","annotation.create","annotation.delete","meta.occupancy"],ct=new Map(ut.map(((e,t)=>[e,t]))),lt=new Map(ut.map(((e,t)=>[t,e])));function ft(e,t,n){if(n&&n.cipher){e||ye("Crypto");const r=e.getCipher(n.cipher,t);return{cipher:r.cipherParams,channelCipher:r.cipher}}return null!=n?n:{}}function ht(e){let t=0;return e.name&&(t+=e.name.length),e.clientId&&(t+=e.clientId.length),e.extras&&(t+=JSON.stringify(e.extras).length),e.data&&(t+=ee(e.data)),t}async function pt(e,t,n,r){const i=Ot(n),o=ft(t,e,null!=r?r:null);try{await yt(i,o)}catch(t){x.logAction(e,x.LOG_ERROR,"Message.fromEncoded()",t.toString())}return i}async function dt(e,t){return Promise.all(e.map((function(e){return async function(e,t){const n=Ot(e);try{await yt(n,t.channelOptions)}catch(e){x.logAction(t.logger,x.LOG_ERROR,"Message._fromEncoded()",e.toString())}return n}(e,t)})))}async function mt(e,t){const n=e.data;if("string"!=typeof n&&!g.BufferUtils.isBuffer(n)&&null!=n){if(!C(n)&&!Array.isArray(n))throw new _("Data type is unsupported",40013,400);e.data=JSON.stringify(n),e.encoding=e.encoding?e.encoding+"/json":"json"}return null!=t&&t.cipher?async function(e,t){let n=e.data,r=e.encoding,i=t.channelCipher;r=r?r+"/":"",g.BufferUtils.isBuffer(n)||(n=g.BufferUtils.utf8Encode(String(n)),r+="utf-8/");const o=await i.encrypt(n);return e.data=o,e.encoding=r+"cipher+"+i.algorithm,e}(e,t):e}async function vt(e,t){return Promise.all(e.map((e=>mt(e,t))))}var gt=ae;async function yt(e,t){const n=function(e){return e&&e.channelOptions?e:{channelOptions:e,plugins:{},baseEncodedPreviousPayload:void 0}}(t);let r=e.data;const i=e.encoding;if(i){const t=i.split("/");let o,a=t.length,s=e.data,u="";try{for(;(o=a)>0;){const e=t[--a].match(/([-\w]+)(\+([\w-]+))?/);if(!e)break;switch(u=e[1],u){case"base64":s=g.BufferUtils.base64Decode(String(s)),o==t.length&&(r=s);continue;case"utf-8":s=g.BufferUtils.utf8Decode(s);continue;case"json":s=JSON.parse(s);continue;case"cipher":if(null!=n.channelOptions&&n.channelOptions.cipher&&n.channelOptions.channelCipher){const t=e[3],r=n.channelOptions.channelCipher;if(t!=r.algorithm)throw new Error("Unable to decrypt message with given cipher; incompatible cipher params");s=await r.decrypt(s);continue}throw new Error("Unable to decrypt message; not an encrypted channel");case"vcdiff":if(!n.plugins||!n.plugins.vcdiff)throw new _("Missing Vcdiff decoder (https://github.com/ably-forks/vcdiff-decoder)",40019,400);if("undefined"==typeof Uint8Array)throw new _("Delta decoding not supported on this browser (need ArrayBuffer & Uint8Array)",40020,400);try{let e=n.baseEncodedPreviousPayload;"string"==typeof e&&(e=g.BufferUtils.utf8Encode(e));const t=g.BufferUtils.toBuffer(e);s=g.BufferUtils.toBuffer(s),s=g.BufferUtils.arrayBufferViewToBuffer(n.plugins.vcdiff.decode(s,t)),r=s}catch(e){throw new _("Vcdiff delta decode failed with "+e,40018,400)}continue;default:throw new Error("Unknown encoding")}}}catch(e){const t=e;throw new _("Error processing the "+u+" encoding, decoder returned ‘"+t.message+"’",t.code||40013,400)}finally{e.encoding=o<=0?null:t.slice(0,o).join("/"),e.data=s}}n.baseEncodedPreviousPayload=r}function bt(e){return Object.assign(new kt,e)}function Ot(e){const t=(n=e.action,lt.get(n)||e.action);var n;const r=Object.assign(new kt,d(p({},e),{action:t}));return r.expandFields(),r}function wt(e){return e.map(bt)}function xt(e){let t,n=0;for(let r=0;r0?(e=e?e+"/base64":"base64",t=g.BufferUtils.base64Encode(t)):t=g.BufferUtils.toBuffer(t)),{name:this.name,id:this.id,clientId:this.clientId,connectionId:this.connectionId,connectionKey:this.connectionKey,extras:this.extras,serial:this.serial,action:(n=this.action,(n?ct.get(n):void 0)||this.action),refSerial:this.refSerial,refType:this.refType,createdAt:this.createdAt,version:this.version,operation:this.operation,encoding:e,data:t};var n}expandFields(){"message.create"===this.action&&(this.version&&!this.serial&&(this.serial=this.version),this.timestamp&&!this.createdAt&&(this.createdAt=this.timestamp))}toString(){let e="[Message";return this.name&&(e+="; name="+this.name),this.id&&(e+="; id="+this.id),this.timestamp&&(e+="; timestamp="+this.timestamp),this.clientId&&(e+="; clientId="+this.clientId),this.connectionId&&(e+="; connectionId="+this.connectionId),this.encoding&&(e+="; encoding="+this.encoding),this.extras&&(e+="; extras ="+JSON.stringify(this.extras)),this.data&&("string"==typeof this.data?e+="; data="+this.data:g.BufferUtils.isBuffer(this.data)?e+="; data (buffer)="+g.BufferUtils.base64Encode(this.data):e+="; data (json)="+JSON.stringify(this.data)),this.extras&&(e+="; extras="+JSON.stringify(this.extras)),this.action&&(e+="; action="+this.action),this.serial&&(e+="; serial="+this.serial),this.version&&(e+="; version="+this.version),this.refSerial&&(e+="; refSerial="+this.refSerial),this.refType&&(e+="; refType="+this.refType),this.createdAt&&(e+="; createdAt="+this.createdAt),this.operation&&(e+="; operation="+JSON.stringify(this.operation)),e+="]",e}},St=kt,_t=["absent","present","enter","leave","update"];async function Pt(e,t,n,r){const i=jt(n),o=ft(t,e,null!=r?r:null);try{await Ct(i,null!=o?o:{})}catch(t){x.logAction(e,x.LOG_ERROR,"PresenceMessage.fromEncoded()",t.toString())}return i}async function Et(e,t){return Promise.all(e.map((function(e){return async function(e,t){const n=jt(e);try{await Ct(n,t.channelOptions)}catch(e){x.logAction(t.logger,x.LOG_ERROR,"PresenceMessage._fromEncoded()",e.toString())}return n}(e,t)})))}function Tt(e){return Object.assign(new $t,e)}function jt(e){const t=_t[e.action];return Object.assign(new $t,d(p({},e),{action:t}))}var Ct=yt;function At(e){return e.map(Tt)}function Rt(e){return e instanceof $t?e:Tt({data:e})}var $t=class{isSynthesized(){return!this.id||!this.connectionId||this.id.substring(this.connectionId.length,0)!==this.connectionId}parseId(){if(!this.id)throw new Error("parseId(): Presence message does not contain an id");const e=this.id.split(":");return{connectionId:e[0],msgSerial:parseInt(e[1],10),index:parseInt(e[2],10)}}toJSON(){let e=this.data,t=this.encoding;return e&&g.BufferUtils.isBuffer(e)&&(arguments.length>0?(t=t?t+"/base64":"base64",e=g.BufferUtils.base64Encode(e)):e=g.BufferUtils.toBuffer(e)),{id:this.id,clientId:this.clientId,action:(n=this.action,_t.indexOf(n)),data:e,encoding:t,extras:this.extras};var n}toString(){let e="[PresenceMessage";return e+="; action="+this.action,this.id&&(e+="; id="+this.id),this.timestamp&&(e+="; timestamp="+this.timestamp),this.clientId&&(e+="; clientId="+this.clientId),this.connectionId&&(e+="; connectionId="+this.connectionId),this.encoding&&(e+="; encoding="+this.encoding),this.data&&("string"==typeof this.data?e+="; data="+this.data:g.BufferUtils.isBuffer(this.data)?e+="; data (buffer)="+g.BufferUtils.base64Encode(this.data):e+="; data (json)="+JSON.stringify(this.data)),this.extras&&(e+="; extras="+JSON.stringify(this.extras)),e+="]",e}},Qt=$t,It=class{constructor(e){this.channel=e}get logger(){return this.channel.logger}async get(e){x.logAction(this.logger,x.LOG_MICRO,"RestPresence.get()","channel = "+this.channel.name);const t=this.channel.client,n=t.options.useBinaryProtocol?"msgpack":"json",r=this.channel.client.http.supportsLinkHeaders?void 0:n,i=Ae.defaultGetHeaders(t.options,{format:n});return E(i,t.options.headers),new tt(t,this.channel.client.rest.presenceMixin.basePath(this),i,r,(async(e,r,i)=>Et(i?e:oe(e,t._MsgPack,n),this.channel))).get(e)}async history(e){return x.logAction(this.logger,x.LOG_MICRO,"RestPresence.history()","channel = "+this.channel.name),this.channel.client.rest.presenceMixin.history(this,e)}},Mt=class{constructor(e,t,n){var r,i;x.logAction(e.logger,x.LOG_MINOR,"RestChannel()","started; name = "+t),this.name=t,this.client=e,this.presence=new It(this),this.channelOptions=Ee(null!=(r=e._Crypto)?r:null,this.logger,n),(null==(i=e.options.plugins)?void 0:i.Push)&&(this._push=new e.options.plugins.Push.PushChannel(this))}get push(){return this._push||ye("Push"),this._push}get logger(){return this.client.logger}setOptions(e){var t;this.channelOptions=Ee(null!=(t=this.client._Crypto)?t:null,this.logger,e)}async history(e){return x.logAction(this.logger,x.LOG_MICRO,"RestChannel.history()","channel = "+this.name),this.client.rest.channelMixin.history(this,e)}async publish(...e){const t=e[0],n=e[1];let r,i;if("string"==typeof t||null===t)r=[bt({name:t,data:n})],i=e[2];else if(C(t))r=[bt(t)],i=e[1];else{if(!Array.isArray(t))throw new _("The single-argument form of publish() expects a message object or an array of message objects",40013,400);r=wt(t),i=e[1]}i||(i={});const o=this.client,a=o.options,s=a.useBinaryProtocol?"msgpack":"json",u=o.options.idempotentRestPublishing,c=Ae.defaultPostHeaders(o.options,{format:s});if(E(c,a.headers),u&&function(e){return e.every((function(e){return!e.id}))}(r)){const e=await ne(9);r.forEach((function(t,n){t.id=e+":"+n.toString()}))}await vt(r,this.channelOptions);const l=xt(r),f=a.maxMessageSize;if(l>f)throw new _("Maximum size of messages that can be published at once exceeded ( was "+l+" bytes; limit is "+f+" bytes)",40009,400);await this._publish(gt(r,o._MsgPack,s),c,i)}async _publish(e,t,n){await He.post(this.client,this.client.rest.channelMixin.basePath(this)+"/messages",e,t,n,null,!0)}async status(){return this.client.rest.channelMixin.status(this)}},Dt=class e{constructor(e){this.entries=e&&e.entries||void 0,this.schema=e&&e.schema||void 0,this.appId=e&&e.appId||void 0,this.inProgress=e&&e.inProgress||void 0,this.unit=e&&e.unit||void 0,this.intervalId=e&&e.intervalId||void 0}static fromValues(t){return new e(t)}},Nt=class{static basePath(e){return"/channels/"+encodeURIComponent(e.name)}static history(e,t){const n=e.client,r=n.options.useBinaryProtocol?"msgpack":"json",i=e.client.http.supportsLinkHeaders?void 0:r,o=Ae.defaultGetHeaders(n.options,{format:r});return E(o,n.options.headers),new tt(n,this.basePath(e)+"/messages",o,i,(async function(t,i,o){return dt(o?t:oe(t,n._MsgPack,r),e)})).get(t)}static async status(e){const t=e.client.options.useBinaryProtocol?"msgpack":"json",n=Ae.defaultPostHeaders(e.client.options,{format:t});return(await He.get(e.client,this.basePath(e),n,{},t,!0)).body}},Ft=class{static basePath(e){return Nt.basePath(e.channel)+"/presence"}static async history(e,t){const n=e.channel.client,r=n.options.useBinaryProtocol?"msgpack":"json",i=e.channel.client.http.supportsLinkHeaders?void 0:r,o=Ae.defaultGetHeaders(n.options,{format:r});return E(o,n.options.headers),new tt(n,this.basePath(e)+"/history",o,i,(async(t,i,o)=>Et(o?t:oe(t,n._MsgPack,r),e.channel))).get(t)}},Lt=class{constructor(e){this.channelMixin=Nt,this.presenceMixin=Ft,this.Resource=He,this.DeviceDetails=Ye,this.client=e,this.channels=new qt(this.client),this.push=new st(this.client)}async stats(e){const t=Ae.defaultGetHeaders(this.client.options),n=this.client.options.useBinaryProtocol?"msgpack":"json",r=this.client.http.supportsLinkHeaders?void 0:n;return E(t,this.client.options.headers),new tt(this.client,"/stats",t,r,(function(e,t,n){const r=n?e:JSON.parse(e);for(let e=0;ethis.client.baseUri(e)+"/time"),t,null,e);if(n)throw n;i||(r=JSON.parse(r));const o=r[0];if(!o)throw new _("Internal error (unexpected result type from GET /time)",5e4,500);return this.client.serverTimeOffset=o-Date.now(),o}async request(e,t,n,r,i,o){var a;const[s,u,c]=(()=>this.client.options.useBinaryProtocol?(this.client._MsgPack||ye("MsgPack"),[this.client._MsgPack.encode,this.client._MsgPack.decode,"msgpack"]):[JSON.stringify,JSON.parse,"json"])(),l=this.client.http.supportsLinkHeaders?void 0:c;r=r||{};const f=e.toLowerCase(),h="get"==f?Ae.defaultGetHeaders(this.client.options,{format:c,protocolVersion:n}):Ae.defaultPostHeaders(this.client.options,{format:c,protocolVersion:n});"string"!=typeof i&&(i=null!=(a=s(i))?a:null),E(h,this.client.options.headers),o&&E(h,o);const p=new tt(this.client,t,h,l,(async function(e,t,n){return j(n?e:u(e))}),!0);if(!g.Http.methods.includes(f))throw new _("Unsupported method "+f,40500,405);return g.Http.methodsWithBody.includes(f)?p[f](r,i):p[f](r)}async batchPublish(e){let t,n;Array.isArray(e)?(t=e,n=!1):(t=[e],n=!0);const r=this.client.options.useBinaryProtocol?"msgpack":"json",i=Ae.defaultPostHeaders(this.client.options,{format:r});this.client.options.headers&&E(i,this.client.options.headers);const o=ae(t,this.client._MsgPack,r),a=await He.post(this.client,"/messages",o,i,{},null,!0),s=a.unpacked?a.body:oe(a.body,this.client._MsgPack,r);return n?s[0]:s}async batchPresence(e){const t=this.client.options.useBinaryProtocol?"msgpack":"json",n=Ae.defaultPostHeaders(this.client.options,{format:t});this.client.options.headers&&E(n,this.client.options.headers);const r=e.join(","),i=await He.get(this.client,"/presence",n,{channels:r},null,!0);return i.unpacked?i.body:oe(i.body,this.client._MsgPack,t)}async revokeTokens(e,t){if(qe(this.client.options))throw new _("Cannot revoke tokens when using token auth",40162,401);const n=this.client.options.keyName;let r=null!=t?t:{};const i=p({targets:e.map((e=>`${e.type}:${e.value}`))},r),o=this.client.options.useBinaryProtocol?"msgpack":"json",a=Ae.defaultPostHeaders(this.client.options,{format:o});this.client.options.headers&&E(a,this.client.options.headers);const s=ae(i,this.client._MsgPack,o),u=await He.post(this.client,`/keys/${n}/revokeTokens`,s,a,{},null,!0);return u.unpacked?u.body:oe(u.body,this.client._MsgPack,o)}},qt=class{constructor(e){this.client=e,this.all=Object.create(null)}get(e,t){e=String(e);let n=this.all[e];return n?t&&n.setOptions(t):this.all[e]=n=new Mt(this.client,e,t),n}release(e){delete this.all[String(e)]}},zt=class extends Xe{constructor(e){super(Ae.objectifyOptions(e,!1,"BaseRest",x.defaultLogger,{Rest:Lt}))}},Ut={Rest:Lt},Bt=class extends St{static async fromEncoded(e,t){return pt(x.defaultLogger,g.Crypto,e,t)}static async fromEncodedArray(e,t){return async function(e,t,n,r){return Promise.all(n.map((function(n){return pt(e,t,n,r)})))}(x.defaultLogger,g.Crypto,e,t)}static fromValues(e){return bt(e)}static fromWireProtocol(e){return Ot(e)}static async encode(e,t){return mt(e,t)}static async decode(e,t){return yt(e,t)}},Zt=class extends Qt{static async fromEncoded(e,t){return Pt(x.defaultLogger,g.Crypto,e,t)}static async fromEncodedArray(e,t){return async function(e,t,n,r){return Promise.all(n.map((function(n){return Pt(e,t,n,r)})))}(x.defaultLogger,g.Crypto,e,t)}static fromValues(e){return Tt(e)}},Vt=class e extends zt{constructor(t){var n,r;if(!e._MsgPack)throw new Error("Expected DefaultRest._MsgPack to have been set");super(Ae.objectifyOptions(t,!0,"Rest",x.defaultLogger,d(p({},Ut),{Crypto:null!=(n=e.Crypto)?n:void 0,MsgPack:null!=(r=e._MsgPack)?r:void 0})))}static get Crypto(){if(null===this._Crypto)throw new Error("Encryption not enabled; use ably.encryption.js instead");return this._Crypto}static set Crypto(e){this._Crypto=e}};Vt._Crypto=null,Vt.Message=Bt,Vt.PresenceMessage=Zt,Vt._MsgPack=null,Vt._Http=Ve;var Wt=Vt;function Xt(e,t,n){let r,i,o;for(let a=0;a{this.on(e,n)}));else{if("string"!=typeof t)throw new Error("EventListener.on(): Invalid arguments: "+g.Config.inspect(e));(this.events[t]||(this.events[t]=[])).push(n)}}}off(...e){if(0==e.length||R(e[0])&&R(e[1]))return this.any=[],this.events=Object.create(null),this.anyOnce=[],void(this.eventsOnce=Object.create(null));const[t,n]=e;let r=null,i=null;if(1!==e.length&&n){if("function"!=typeof n)throw new Error("EventEmitter.off(): invalid arguments:"+g.Config.inspect(e));[i,r]=[t,n]}else"function"==typeof t?r=t:i=t;if(r&&R(i))Xt([this.any,this.events,this.anyOnce,this.eventsOnce],r);else if(Array.isArray(i))i.forEach((e=>{this.off(e,r)}));else{if("string"!=typeof i)throw new Error("EventEmitter.off(): invalid arguments:"+g.Config.inspect(e));r?Xt([this.events,this.eventsOnce],r,i):(delete this.events[i],delete this.eventsOnce[i])}}listeners(e){if(e){const t=this.events[e]||[];return this.eventsOnce[e]&&Array.prototype.push.apply(t,this.eventsOnce[e]),t.length?t:null}return this.any.length?this.any:null}emit(e,...t){const n={event:e},r=[];this.anyOnce.length&&(Array.prototype.push.apply(r,this.anyOnce),this.anyOnce=[]),this.any.length&&Array.prototype.push.apply(r,this.any);const i=this.eventsOnce[e];i&&(Array.prototype.push.apply(r,i),delete this.eventsOnce[e]);const o=this.events[e];o&&Array.prototype.push.apply(r,o),r.forEach((e=>{!function(e,t,n,r){try{n.apply(t,r)}catch(t){x.logAction(e,x.LOG_ERROR,"EventEmitter.emit()","Unexpected listener exception: "+t+"; stack = "+(t&&t.stack))}}(this.logger,n,e,t)}))}once(...e){const t=e.length;if(0===t||1===t&&"function"!=typeof e[0]){const t=e[0];return new Promise((e=>{this.once(t,e)}))}const[n,r]=e;if(1===e.length&&"function"==typeof n)this.anyOnce.push(n);else if(R(n)){if("function"!=typeof r)throw new Error("EventEmitter.once(): Invalid arguments:"+g.Config.inspect(e));this.anyOnce.push(r)}else if(Array.isArray(n)){const t=this,i=function(){const o=Array.prototype.slice.call(arguments);if(n.forEach((function(e){t.off(e,i)})),"function"!=typeof r)throw new Error("EventEmitter.once(): Invalid arguments:"+g.Config.inspect(e));r.apply(this,o)};n.forEach((function(e){t.on(e,i)}))}else{if("string"!=typeof n)throw new Error("EventEmitter.once(): Invalid arguments:"+g.Config.inspect(e));const t=this.eventsOnce[n]||(this.eventsOnce[n]=[]);if(r){if("function"!=typeof r)throw new Error("EventEmitter.once(): Invalid arguments:"+g.Config.inspect(e));t.push(r)}}}async whenState(e,t){if("string"!=typeof e||"string"!=typeof t)throw new Error("whenState requires a valid state String argument");return e===t?null:this.once(e)}},Gt={HEARTBEAT:0,ACK:1,NACK:2,CONNECT:3,CONNECTED:4,DISCONNECT:5,DISCONNECTED:6,CLOSE:7,CLOSED:8,ERROR:9,ATTACH:10,ATTACHED:11,DETACH:12,DETACHED:13,PRESENCE:14,MESSAGE:15,SYNC:16,AUTH:17,ACTIVATE:18},Ht=[];Object.keys(Gt).forEach((function(e){Ht[Gt[e]]=e}));var Kt={HAS_PRESENCE:1,HAS_BACKLOG:2,RESUMED:4,TRANSIENT:16,ATTACH_RESUME:32,PRESENCE:65536,PUBLISH:1<<17,SUBSCRIBE:1<<18,PRESENCE_SUBSCRIBE:1<<19},Jt=Object.keys(Kt);function en(e){const t=[];if(e)for(let n=0;nOt(e)))),t&&e.presence&&(i=e.presence.map((e=>t.presenceMessageFromWireProtocol(e)))),Object.assign(new ln,d(p({},e),{presence:i,messages:r}))}function on(e){return rn(e,{presenceMessageFromValues:Tt,presenceMessagesFromValuesArray:At,presenceMessageFromWireProtocol:jt})}function an(e){return Object.assign(new ln,e)}function sn(e,t){let n="[ProtocolMessage";void 0!==e.action&&(n+="; action="+Ht[e.action]||!1);const r=["id","channel","channelSerial","connectionId","count","msgSerial","timestamp"];let i;for(let t=0;t0&&(t+="; "),t+=n+"="+e.params[n]})),t.length>0&&(n+="; params=["+t+"]")}return n+="]",n}var un,cn,ln=class{constructor(){this.hasFlag=e=>(this.flags&Kt[e])>0}setFlag(e){return this.flags=this.flags|Kt[e]}getMode(){return this.flags&&this.flags&Kt.MODE_ALL}encodeModesToFlags(e){e.forEach((e=>this.setFlag(e)))}decodeModesFromFlags(){const e=[];return tn.forEach((t=>{this.hasFlag(t)&&e.push(t)})),e.length>0?e:void 0}},fn=ln,hn=class extends Yt{constructor(e){super(e),this.messages=[]}count(){return this.messages.length}push(e){this.messages.push(e)}shift(){return this.messages.shift()}last(){return this.messages[this.messages.length-1]}copyAll(){return this.messages.slice()}append(e){this.messages.push.apply(this.messages,e)}prepend(e){this.messages.unshift.apply(this.messages,e)}completeMessages(e,t,n){x.logAction(this.logger,x.LOG_MICRO,"MessageQueue.completeMessages()","serial = "+e+"; count = "+t),n=n||null;const r=this.messages;if(0===r.length)throw new Error("MessageQueue.completeMessages(): completeMessages called on any empty MessageQueue");const i=r[0];if(i){const o=i.message.msgSerial,a=e+t;if(a>o){const e=r.splice(0,a-o);for(const t of e)t.callback(n)}0==r.length&&this.emit("idle")}}completeAllMessages(e){this.completeMessages(0,Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,e)}resetSendAttempted(){for(let e of this.messages)e.sendAttempted=!1}clear(){x.logAction(this.logger,x.LOG_MICRO,"MessageQueue.clear()","clearing "+this.messages.length+" messages"),this.messages=[],this.emit("idle")}},pn=class{constructor(e,t){this.message=e,this.callback=t,this.merged=!1;const n=e.action;this.sendAttempted=!1,this.ackRequired=n==Gt.MESSAGE||n==Gt.PRESENCE}},dn=class extends Yt{constructor(e){super(e.logger),this.transport=e,this.messageQueue=new hn(this.logger),e.on("ack",((e,t)=>{this.onAck(e,t)})),e.on("nack",((e,t,n)=>{this.onNack(e,t,n)}))}onAck(e,t){x.logAction(this.logger,x.LOG_MICRO,"Protocol.onAck()","serial = "+e+"; count = "+t),this.messageQueue.completeMessages(e,t)}onNack(e,t,n){x.logAction(this.logger,x.LOG_ERROR,"Protocol.onNack()","serial = "+e+"; count = "+t+"; err = "+K(n)),n||(n=new _("Unable to send message; channel not responding",50001,500)),this.messageQueue.completeMessages(e,t,n)}onceIdle(e){const t=this.messageQueue;0!==t.count()?t.once("idle",e):e()}send(e){e.ackRequired&&this.messageQueue.push(e),this.logger.shouldLog(x.LOG_MICRO)&&x.logActionNoStrip(this.logger,x.LOG_MICRO,"Protocol.send()","sending msg; "+sn(e.message,this.transport.connectionManager.realtime._RealtimePresence)),e.sendAttempted=!0,this.transport.send(e.message)}getTransport(){return this.transport}getPendingMessages(){return this.messageQueue.copyAll()}clearPendingMessages(){return this.messageQueue.clear()}finish(){const e=this.transport;this.onceIdle((function(){e.disconnect()}))}},mn=class{constructor(e,t,n,r){this.previous=e,this.current=t,n&&(this.retryIn=n),r&&(this.reason=r)}},vn={DISCONNECTED:80003,SUSPENDED:80002,FAILED:8e4,CLOSING:80017,CLOSED:80017,UNKNOWN_CONNECTION_ERR:50002,UNKNOWN_CHANNEL_ERR:50001},gn={disconnected:()=>_.fromValues({statusCode:400,code:vn.DISCONNECTED,message:"Connection to server temporarily unavailable"}),suspended:()=>_.fromValues({statusCode:400,code:vn.SUSPENDED,message:"Connection to server unavailable"}),failed:()=>_.fromValues({statusCode:400,code:vn.FAILED,message:"Connection failed or disconnected by server"}),closing:()=>_.fromValues({statusCode:400,code:vn.CLOSING,message:"Connection closing"}),closed:()=>_.fromValues({statusCode:400,code:vn.CLOSED,message:"Connection closed"}),unknownConnectionErr:()=>_.fromValues({statusCode:500,code:vn.UNKNOWN_CONNECTION_ERR,message:"Internal connection error"}),unknownChannelErr:()=>_.fromValues({statusCode:500,code:vn.UNKNOWN_CONNECTION_ERR,message:"Internal channel error"})},yn=an({action:Gt.CLOSE}),bn=an({action:Gt.DISCONNECT}),On=class extends Yt{constructor(e,t,n,r){super(e.logger),r&&(n.format=void 0,n.heartbeats=!0),this.connectionManager=e,this.auth=t,this.params=n,this.timeouts=n.options.timeouts,this.format=n.format,this.isConnected=!1,this.isFinished=!1,this.isDisposed=!1,this.maxIdleInterval=null,this.idleTimer=null,this.lastActivity=null}connect(){}close(){this.isConnected&&this.requestClose(),this.finish("closed",gn.closed())}disconnect(e){this.isConnected&&this.requestDisconnect(),this.finish("disconnected",e||gn.disconnected())}fail(e){this.isConnected&&this.requestDisconnect(),this.finish("failed",e||gn.failed())}finish(e,t){var n;this.isFinished||(this.isFinished=!0,this.isConnected=!1,this.maxIdleInterval=null,clearTimeout(null!=(n=this.idleTimer)?n:void 0),this.idleTimer=null,this.emit(e,t),this.dispose())}onProtocolMessage(e){switch(this.logger.shouldLog(x.LOG_MICRO)&&x.logActionNoStrip(this.logger,x.LOG_MICRO,"Transport.onProtocolMessage()","received on "+this.shortName+": "+sn(e,this.connectionManager.realtime._RealtimePresence)+"; connectionId = "+this.connectionManager.connectionId),this.onActivity(),e.action){case Gt.HEARTBEAT:x.logActionNoStrip(this.logger,x.LOG_MICRO,"Transport.onProtocolMessage()",this.shortName+" heartbeat; connectionId = "+this.connectionManager.connectionId),this.emit("heartbeat",e.id);break;case Gt.CONNECTED:this.onConnect(e),this.emit("connected",e.error,e.connectionId,e.connectionDetails,e);break;case Gt.CLOSED:this.onClose(e);break;case Gt.DISCONNECTED:this.onDisconnect(e);break;case Gt.ACK:this.emit("ack",e.msgSerial,e.count);break;case Gt.NACK:this.emit("nack",e.msgSerial,e.count,e.error);break;case Gt.SYNC:this.connectionManager.onChannelMessage(e,this);break;case Gt.ACTIVATE:break;case Gt.AUTH:ie(this.auth.authorize(),(e=>{e&&x.logAction(this.logger,x.LOG_ERROR,"Transport.onProtocolMessage()","Ably requested re-authentication, but unable to obtain a new token: "+K(e))}));break;case Gt.ERROR:if(x.logAction(this.logger,x.LOG_MINOR,"Transport.onProtocolMessage()","received error action; connectionId = "+this.connectionManager.connectionId+"; err = "+g.Config.inspect(e.error)+(e.channel?", channel: "+e.channel:"")),void 0===e.channel){this.onFatalError(e);break}this.connectionManager.onChannelMessage(e,this);break;default:this.connectionManager.onChannelMessage(e,this)}}onConnect(e){if(this.isConnected=!0,!e.connectionDetails)throw new Error("Transport.onConnect(): Connect message recieved without connectionDetails");const t=e.connectionDetails.maxIdleInterval;t&&(this.maxIdleInterval=t+this.timeouts.realtimeRequestTimeout,this.onActivity())}onDisconnect(e){const t=e&&e.error;x.logAction(this.logger,x.LOG_MINOR,"Transport.onDisconnect()","err = "+K(t)),this.finish("disconnected",t)}onFatalError(e){const t=e&&e.error;x.logAction(this.logger,x.LOG_MINOR,"Transport.onFatalError()","err = "+K(t)),this.finish("failed",t)}onClose(e){const t=e&&e.error;x.logAction(this.logger,x.LOG_MINOR,"Transport.onClose()","err = "+K(t)),this.finish("closed",t)}requestClose(){x.logAction(this.logger,x.LOG_MINOR,"Transport.requestClose()",""),this.send(yn)}requestDisconnect(){x.logAction(this.logger,x.LOG_MINOR,"Transport.requestDisconnect()",""),this.send(bn)}ping(e){const t={action:Gt.HEARTBEAT};e&&(t.id=e),this.send(an(t))}dispose(){x.logAction(this.logger,x.LOG_MINOR,"Transport.dispose()",""),this.isDisposed=!0,this.off()}onActivity(){this.maxIdleInterval&&(this.lastActivity=this.connectionManager.lastActivity=Date.now(),this.setIdleTimer(this.maxIdleInterval+100))}setIdleTimer(e){this.idleTimer||(this.idleTimer=setTimeout((()=>{this.onIdleTimerExpire()}),e))}onIdleTimerExpire(){if(!this.lastActivity||!this.maxIdleInterval)throw new Error("Transport.onIdleTimerExpire(): lastActivity/maxIdleInterval not set");this.idleTimer=null;const e=Date.now()-this.lastActivity,t=this.maxIdleInterval-e;if(t<=0){const t="No activity seen from realtime in "+e+"ms; assuming connection has dropped";x.logAction(this.logger,x.LOG_ERROR,"Transport.onIdleTimerExpire()",t),this.disconnect(new _(t,80003,408))}else this.setIdleTimer(t+100)}static tryConnect(e,t,n,r,i){const o=new e(t,n,r);let a;const s=function(e){clearTimeout(a),i({event:this.event,error:e})},u=t.options.timeouts.realtimeRequestTimeout;return a=setTimeout((()=>{o.off(["preconnect","disconnected","failed"]),o.dispose(),s.call({event:"disconnected"},new _("Timeout waiting for transport to indicate itself viable",5e4,500))}),u),o.on(["failed","disconnected"],s),o.on("preconnect",(function(){x.logAction(t.logger,x.LOG_MINOR,"Transport.tryConnect()","viable transport "+o),clearTimeout(a),o.off(["failed","disconnected"],s),i(null,o)})),o.connect(),o}static isAvailable(){throw new _("isAvailable not implemented for transport",5e4,500)}};(cn=un||(un={})).WebSocket="web_socket",cn.Comet="comet",cn.XhrPolling="xhr_polling";var wn=void 0!==t?t:"undefined"!=typeof window?window:self,xn=()=>{var e;return void 0!==g.WebStorage&&(null==(e=g.WebStorage)?void 0:e.localSupported)},kn=()=>{var e;return void 0!==g.WebStorage&&(null==(e=g.WebStorage)?void 0:e.sessionSupported)},Sn=function(){},_n="ably-transport-preference";function Pn(e){try{return JSON.parse(e)}catch(e){return null}}var En=class e extends Yt{constructor(e,t){super(e.logger),this.supportedTransports={},this.disconnectedRetryCount=0,this.pendingChannelMessagesState={isProcessing:!1,queue:[]},this.realtime=e,this.initTransports(),this.options=t;const n=t.timeouts,r=n.webSocketConnectTimeout+n.realtimeRequestTimeout;if(this.states={initialized:{state:"initialized",terminal:!1,queueEvents:!0,sendEvents:!1,failState:"disconnected"},connecting:{state:"connecting",terminal:!1,queueEvents:!0,sendEvents:!1,retryDelay:r,failState:"disconnected"},connected:{state:"connected",terminal:!1,queueEvents:!1,sendEvents:!0,failState:"disconnected"},disconnected:{state:"disconnected",terminal:!1,queueEvents:!0,sendEvents:!1,retryDelay:n.disconnectedRetryTimeout,failState:"disconnected"},suspended:{state:"suspended",terminal:!1,queueEvents:!1,sendEvents:!1,retryDelay:n.suspendedRetryTimeout,failState:"suspended"},closing:{state:"closing",terminal:!1,queueEvents:!1,sendEvents:!1,retryDelay:n.realtimeRequestTimeout,failState:"closed"},closed:{state:"closed",terminal:!0,queueEvents:!1,sendEvents:!1,failState:"closed"},failed:{state:"failed",terminal:!0,queueEvents:!1,sendEvents:!1,failState:"failed"}},this.state=this.states.initialized,this.errorReason=null,this.queuedMessages=new hn(this.logger),this.msgSerial=0,this.connectionDetails=void 0,this.connectionId=void 0,this.connectionKey=void 0,this.connectionStateTtl=n.connectionStateTtl,this.maxIdleInterval=null,this.transports=D(t.transports||Ae.defaultTransports,this.supportedTransports),this.transportPreference=null,this.transports.includes(un.WebSocket)&&(this.webSocketTransportAvailable=!0),this.transports.includes(un.XhrPolling)?this.baseTransport=un.XhrPolling:this.transports.includes(un.Comet)&&(this.baseTransport=un.Comet),this.httpHosts=Ae.getHosts(t),this.wsHosts=Ae.getHosts(t,!0),this.activeProtocol=null,this.host=null,this.lastAutoReconnectAttempt=null,this.lastActivity=null,this.forceFallbackHost=!1,this.connectCounter=0,this.wsCheckResult=null,this.webSocketSlowTimer=null,this.webSocketGiveUpTimer=null,this.abandonedWebSocket=!1,x.logAction(this.logger,x.LOG_MINOR,"Realtime.ConnectionManager()","started"),x.logAction(this.logger,x.LOG_MICRO,"Realtime.ConnectionManager()","requested transports = ["+(t.transports||Ae.defaultTransports)+"]"),x.logAction(this.logger,x.LOG_MICRO,"Realtime.ConnectionManager()","available transports = ["+this.transports+"]"),x.logAction(this.logger,x.LOG_MICRO,"Realtime.ConnectionManager()","http hosts = ["+this.httpHosts+"]"),!this.transports.length){const e="no requested transports available";throw x.logAction(this.logger,x.LOG_ERROR,"realtime.ConnectionManager()",e),new Error(e)}const i=g.Config.addEventListener;i&&(kn()&&"function"==typeof t.recover&&i("beforeunload",this.persistConnection.bind(this)),!0===t.closeOnUnload&&i("beforeunload",(()=>{x.logAction(this.logger,x.LOG_MAJOR,"Realtime.ConnectionManager()","beforeunload event has triggered the connection to close as closeOnUnload is true"),this.requestState({state:"closing"})})),i("online",(()=>{var e;this.state==this.states.disconnected||this.state==this.states.suspended?(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager caught browser ‘online’ event","reattempting connection"),this.requestState({state:"connecting"})):this.state==this.states.connecting&&(null==(e=this.pendingTransport)||e.off(),this.disconnectAllTransports(),this.startConnect())})),i("offline",(()=>{this.state==this.states.connected&&(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager caught browser ‘offline’ event","disconnecting active transport"),this.disconnectAllTransports())})))}static supportedTransports(e){const t={supportedTransports:{}};return this.initTransports(e,t),t.supportedTransports}static initTransports(e,t){const n=p(p({},g.Transports.bundledImplementations),e);[un.WebSocket,...g.Transports.order].forEach((e=>{const r=n[e];r&&r.isAvailable()&&(t.supportedTransports[e]=r)}))}initTransports(){e.initTransports(this.realtime._additionalTransportImplementations,this)}createTransportParams(e,t){return new class{constructor(e,t,n,r){this.options=e,this.host=t,this.mode=n,this.connectionKey=r,this.format=e.useBinaryProtocol?"msgpack":"json"}getConnectParams(e){const t=e?T(e):{},n=this.options;switch(this.mode){case"resume":t.resume=this.connectionKey;break;case"recover":{const e=Pn(n.recover);e&&(t.recover=e.connectionKey);break}}return void 0!==n.clientId&&(t.clientId=n.clientId),!1===n.echoMessages&&(t.echo="false"),void 0!==this.format&&(t.format=this.format),void 0!==this.stream&&(t.stream=this.stream),void 0!==this.heartbeats&&(t.heartbeats=this.heartbeats),t.v=Ae.protocolVersion,t.agent=Pe(this.options),void 0!==n.transportParams&&E(t,n.transportParams),t}toString(){let e="[mode="+this.mode;return this.host&&(e+=",host="+this.host),this.connectionKey&&(e+=",connectionKey="+this.connectionKey),this.format&&(e+=",format="+this.format),e+="]",e}}(this.options,e,t,this.connectionKey)}getTransportParams(e){(e=>{if(this.connectionKey)return void e("resume");if("string"==typeof this.options.recover)return void e("recover");const t=this.options.recover,n=this.getSessionRecoverData(),r=this.sessionRecoveryName();if(n&&"function"==typeof t)return x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.getTransportParams()","Calling clientOptions-provided recover function with last session data (recovery scope: "+r+")"),void t(n,(t=>{t?(this.options.recover=n.recoveryKey,e("recover")):e("clean")}));e("clean")})((t=>{const n=this.createTransportParams(null,t);if("recover"===t){x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.getTransportParams()","Transport recovery mode = recover; recoveryKey = "+this.options.recover);const e=Pn(this.options.recover);e&&(this.msgSerial=e.msgSerial)}else x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.getTransportParams()","Transport params = "+n.toString());e(n)}))}tryATransport(e,t,n){x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.tryATransport()","trying "+t),this.proposedTransport=On.tryConnect(this.supportedTransports[t],this,this.realtime.auth,e,((r,i)=>{const o=this.state;return o==this.states.closing||o==this.states.closed||o==this.states.failed?(i&&(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.tryATransport()","connection "+o.state+" while we were attempting the transport; closing "+i),i.close()),void n(!0)):r?(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.tryATransport()","transport "+t+" "+r.event+", err: "+r.error.toString()),void(!Ue.isTokenErr(r.error)||this.errorReason&&Ue.isTokenErr(this.errorReason)?"failed"===r.event?(this.notifyState({state:"failed",error:r.error}),n(!0)):"disconnected"===r.event&&(!(a=r.error).statusCode||!a.code||a.statusCode>=500||Object.values(vn).includes(a.code)?n(!1):(this.notifyState({state:this.states.connecting.failState,error:r.error}),n(!0))):(this.errorReason=r.error,ie(this.realtime.auth._forceNewToken(null,null),(r=>{r?this.actOnErrorFromAuthorize(r):this.tryATransport(e,t,n)}))))):(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.tryATransport()","viable transport "+t+"; setting pending"),this.setTransportPending(i,e),void n(null,i));var a}))}setTransportPending(e,t){const n=t.mode;x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.setTransportPending()","transport = "+e+"; mode = "+n),this.pendingTransport=e,this.cancelWebSocketSlowTimer(),this.cancelWebSocketGiveUpTimer(),e.once("connected",((t,r,i)=>{this.activateTransport(t,e,r,i),"recover"===n&&this.options.recover&&(delete this.options.recover,this.unpersistConnection())}));const r=this;e.on(["disconnected","closed","failed"],(function(t){r.deactivateTransport(e,this.event,t)})),this.emit("transport.pending",e)}activateTransport(e,t,n,r){x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.activateTransport()","transport = "+t),e&&x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.activateTransport()","error = "+e),n&&x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.activateTransport()","connectionId = "+n),r&&x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.activateTransport()","connectionDetails = "+JSON.stringify(r)),this.persistTransportPreference(t);const i=this.state,o=this.states.connected.state;if(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.activateTransport()","current state = "+i.state),i.state==this.states.closing.state||i.state==this.states.closed.state||i.state==this.states.failed.state)return x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.activateTransport()","Disconnecting transport and abandoning"),t.disconnect(),!1;if(delete this.pendingTransport,!t.isConnected)return x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.activateTransport()","Declining to activate transport "+t+" since it appears to no longer be connected"),!1;const a=this.activeProtocol;this.activeProtocol=new dn(t),this.host=t.params.host;const s=r.connectionKey;if(s&&this.connectionKey!=s&&this.setConnection(n,r,!!e),this.onConnectionDetailsUpdate(r,t),g.Config.nextTick((()=>{t.on("connected",((e,n,r)=>{this.onConnectionDetailsUpdate(r,t),this.emit("update",new mn(o,o,null,e))}))})),i.state===this.states.connected.state?e&&(this.errorReason=this.realtime.connection.errorReason=e,this.emit("update",new mn(o,o,null,e))):(this.notifyState({state:"connected",error:e}),this.errorReason=this.realtime.connection.errorReason=e||null),this.emit("transport.active",t),a)if(a.messageQueue.count()>0&&x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.activateTransport()","Previous active protocol (for transport "+a.transport.shortName+", new one is "+t.shortName+") finishing with "+a.messageQueue.count()+" messages still pending"),a.transport===t){const e="Assumption violated: activating a transport that was also the transport for the previous active protocol; transport = "+t.shortName+"; stack = "+(new Error).stack;x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.activateTransport()",e)}else a.finish();return!0}deactivateTransport(e,t,n){const r=this.activeProtocol,i=r&&r.getTransport()===e,o=e===this.pendingTransport,a=this.noTransportsScheduledForActivation();if(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.deactivateTransport()","transport = "+e),x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.deactivateTransport()","state = "+t+(i?"; was active":o?"; was pending":"")+(a?"":"; another transport is scheduled for activation")),n&&n.message&&x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.deactivateTransport()","reason = "+n.message),i&&(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.deactivateTransport()","Getting, clearing, and requeuing "+this.activeProtocol.messageQueue.count()+" pending messages"),this.queuePendingMessages(r.getPendingMessages()),r.clearPendingMessages(),this.activeProtocol=this.host=null),this.emit("transport.inactive",e),i&&a||i&&"failed"===t||"closed"===t||null===r&&o){if("disconnected"===t&&n&&n.statusCode>500&&this.httpHosts.length>1)return this.unpersistTransportPreference(),this.forceFallbackHost=!0,void this.notifyState({state:t,error:n,retryImmediately:!0});const e="failed"===t&&Ue.isTokenErr(n)?"disconnected":t;this.notifyState({state:e,error:n})}}noTransportsScheduledForActivation(){return!this.pendingTransport||!this.pendingTransport.isConnected}setConnection(e,t,n){const r=this.connectionId;(r&&r!==e||!r&&n)&&(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.setConnection()","Resetting msgSerial"),this.msgSerial=0,this.queuedMessages.resetSendAttempted()),this.connectionId!==e&&x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.setConnection()","New connectionId; reattaching any attached channels"),this.realtime.connection.id=this.connectionId=e,this.realtime.connection.key=this.connectionKey=t.connectionKey}clearConnection(){this.realtime.connection.id=this.connectionId=void 0,this.realtime.connection.key=this.connectionKey=void 0,this.msgSerial=0,this.unpersistConnection()}createRecoveryKey(){return this.connectionKey?JSON.stringify({connectionKey:this.connectionKey,msgSerial:this.msgSerial,channelSerials:this.realtime.channels.channelSerials()}):null}checkConnectionStateFreshness(){if(!this.lastActivity||!this.connectionId)return;const e=Date.now()-this.lastActivity;e>this.connectionStateTtl+this.maxIdleInterval&&(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.checkConnectionStateFreshness()","Last known activity from realtime was "+e+"ms ago; discarding connection state"),this.clearConnection(),this.states.connecting.failState="suspended")}persistConnection(){if(kn()){const e=this.createRecoveryKey();e&&this.setSessionRecoverData({recoveryKey:e,disconnectedAt:Date.now(),location:wn.location,clientId:this.realtime.auth.clientId})}}unpersistConnection(){this.clearSessionRecoverData()}getError(){if(this.errorReason){const e=P.fromValues(this.errorReason);return e.cause=this.errorReason,e}return this.getStateError()}getStateError(){var e,t;return null==(t=(e=gn)[this.state.state])?void 0:t.call(e)}activeState(){return this.state.queueEvents||this.state.sendEvents}enactStateChange(e){const t="Connection state",n=e.current+(e.reason?"; reason: "+e.reason:"");"failed"===e.current?x.logAction(this.logger,x.LOG_ERROR,t,n):x.logAction(this.logger,x.LOG_MAJOR,t,n),x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.enactStateChange","setting new state: "+e.current+"; reason = "+(e.reason&&e.reason.message));const r=this.state=this.states[e.current];e.reason&&(this.errorReason=e.reason,this.realtime.connection.errorReason=e.reason),(r.terminal||"suspended"===r.state)&&this.clearConnection(),this.emit("connectionstate",e)}startTransitionTimer(e){x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.startTransitionTimer()","transitionState: "+e.state),this.transitionTimer&&(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.startTransitionTimer()","clearing already-running timer"),clearTimeout(this.transitionTimer)),this.transitionTimer=setTimeout((()=>{this.transitionTimer&&(this.transitionTimer=null,x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager "+e.state+" timer expired","requesting new state: "+e.failState),this.notifyState({state:e.failState}))}),e.retryDelay)}cancelTransitionTimer(){x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.cancelTransitionTimer()",""),this.transitionTimer&&(clearTimeout(this.transitionTimer),this.transitionTimer=null)}startSuspendTimer(){this.suspendTimer||(this.suspendTimer=setTimeout((()=>{this.suspendTimer&&(this.suspendTimer=null,x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager suspend timer expired","requesting new state: suspended"),this.states.connecting.failState="suspended",this.notifyState({state:"suspended"}))}),this.connectionStateTtl))}checkSuspendTimer(e){"disconnected"!==e&&"suspended"!==e&&"connecting"!==e&&this.cancelSuspendTimer()}cancelSuspendTimer(){this.states.connecting.failState="disconnected",this.suspendTimer&&(clearTimeout(this.suspendTimer),this.suspendTimer=null)}startRetryTimer(e){this.retryTimer=setTimeout((()=>{x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager retry timer expired","retrying"),this.retryTimer=null,this.requestState({state:"connecting"})}),e)}cancelRetryTimer(){this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null)}startWebSocketSlowTimer(){this.webSocketSlowTimer=setTimeout((()=>{x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager WebSocket slow timer","checking connectivity"),this.checkWsConnectivity().then((()=>{x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager WebSocket slow timer","ws connectivity check succeeded"),this.wsCheckResult=!0})).catch((()=>{x.logAction(this.logger,x.LOG_MAJOR,"ConnectionManager WebSocket slow timer","ws connectivity check failed"),this.wsCheckResult=!1})),this.realtime.http.checkConnectivity&&ie(this.realtime.http.checkConnectivity(),((e,t)=>{e||!t?(x.logAction(this.logger,x.LOG_MAJOR,"ConnectionManager WebSocket slow timer","http connectivity check failed"),this.cancelWebSocketGiveUpTimer(),this.notifyState({state:"disconnected",error:new _("Unable to connect (network unreachable)",80003,404)})):x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager WebSocket slow timer","http connectivity check succeeded")}))}),this.options.timeouts.webSocketSlowTimeout)}cancelWebSocketSlowTimer(){this.webSocketSlowTimer&&(clearTimeout(this.webSocketSlowTimer),this.webSocketSlowTimer=null)}startWebSocketGiveUpTimer(e){this.webSocketGiveUpTimer=setTimeout((()=>{var t,n;this.wsCheckResult||(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager WebSocket give up timer","websocket connection took more than 10s; "+(this.baseTransport?"trying base transport":"")),this.baseTransport?(this.abandonedWebSocket=!0,null==(t=this.proposedTransport)||t.dispose(),null==(n=this.pendingTransport)||n.dispose(),this.connectBase(e,++this.connectCounter)):x.logAction(this.logger,x.LOG_MAJOR,"ConnectionManager WebSocket give up timer","websocket connectivity appears to be unavailable but no other transports to try"))}),this.options.timeouts.webSocketConnectTimeout)}cancelWebSocketGiveUpTimer(){this.webSocketGiveUpTimer&&(clearTimeout(this.webSocketGiveUpTimer),this.webSocketGiveUpTimer=null)}notifyState(e){var t,n;const r=e.state,i="disconnected"===r&&(this.state===this.states.connected||e.retryImmediately||this.state===this.states.connecting&&e.error&&Ue.isTokenErr(e.error)&&!(this.errorReason&&Ue.isTokenErr(this.errorReason)));if(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.notifyState()","new state: "+r+(i?"; will retry connection immediately":"")),r==this.state.state)return;if(this.cancelTransitionTimer(),this.cancelRetryTimer(),this.cancelWebSocketSlowTimer(),this.cancelWebSocketGiveUpTimer(),this.checkSuspendTimer(e.state),"suspended"!==r&&"connected"!==r||(this.disconnectedRetryCount=0),this.state.terminal)return;const o=this.states[e.state];let a=o.retryDelay;"disconnected"===o.state&&(this.disconnectedRetryCount++,a=fe(o.retryDelay,this.disconnectedRetryCount));const s=new mn(this.state.state,o.state,a,e.error||(null==(n=(t=gn)[o.state])?void 0:n.call(t)));if(i){const e=()=>{this.state===this.states.disconnected&&(this.lastAutoReconnectAttempt=Date.now(),this.requestState({state:"connecting"}))},t=this.lastAutoReconnectAttempt&&Date.now()-this.lastAutoReconnectAttempt+1;t&&t<1e3?(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.notifyState()","Last reconnect attempt was only "+t+"ms ago, waiting another "+(1e3-t)+"ms before trying again"),setTimeout(e,1e3-t)):g.Config.nextTick(e)}else"disconnected"!==r&&"suspended"!==r||this.startRetryTimer(a);("disconnected"===r&&!i||"suspended"===r||o.terminal)&&g.Config.nextTick((()=>{this.disconnectAllTransports()})),"connected"!=r||this.activeProtocol||x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.notifyState()","Broken invariant: attempted to go into connected state, but there is no active protocol"),this.enactStateChange(s),this.state.sendEvents?this.sendQueuedMessages():this.state.queueEvents||(this.realtime.channels.propogateConnectionInterruption(r,s.reason),this.failQueuedMessages(s.reason))}requestState(e){var t,n;const r=e.state;if(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.requestState()","requested state: "+r+"; current state: "+this.state.state),r==this.state.state)return;if(this.cancelWebSocketSlowTimer(),this.cancelWebSocketGiveUpTimer(),this.cancelTransitionTimer(),this.cancelRetryTimer(),this.checkSuspendTimer(r),"connecting"==r&&"connected"==this.state.state)return;if("closing"==r&&"closed"==this.state.state)return;const i=this.states[r],o=new mn(this.state.state,i.state,null,e.error||(null==(n=(t=gn)[i.state])?void 0:n.call(t)));this.enactStateChange(o),"connecting"==r&&g.Config.nextTick((()=>{this.startConnect()})),"closing"==r&&this.closeImpl()}startConnect(){if(this.state!==this.states.connecting)return void x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.startConnect()","Must be in connecting state to connect, but was "+this.state.state);const e=this.realtime.auth,t=++this.connectCounter,n=()=>{this.checkConnectionStateFreshness(),this.getTransportParams((e=>{if("recover"===e.mode&&e.options.recover){const t=Pn(e.options.recover);t&&this.realtime.channels.recoverChannels(t.channelSerials)}t===this.connectCounter&&this.connectImpl(e,t)}))};if(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.startConnect()","starting connection"),this.startSuspendTimer(),this.startTransitionTimer(this.states.connecting),"basic"===e.method)n();else{const r=e=>{t===this.connectCounter&&(e?this.actOnErrorFromAuthorize(e):n())};this.errorReason&&Ue.isTokenErr(this.errorReason)?ie(e._forceNewToken(null,null),r):ie(e._ensureValidAuthCredentials(!1),r)}}connectImpl(e,t){const n=this.state.state;if(n!==this.states.connecting.state)return void x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.connectImpl()","Must be in connecting state to connect, but was "+n);const r=this.getTransportPreference();r&&r===this.baseTransport&&this.webSocketTransportAvailable&&this.checkWsConnectivity().then((()=>{this.unpersistTransportPreference(),this.state===this.states.connecting&&(x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.connectImpl():","web socket connectivity available, cancelling connection attempt with "+this.baseTransport),this.disconnectAllTransports(),this.connectWs(e,++this.connectCounter))})).catch(Sn),r&&r===this.baseTransport||this.baseTransport&&!this.webSocketTransportAvailable?this.connectBase(e,t):this.connectWs(e,t)}connectWs(e,t){x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.connectWs()"),this.wsCheckResult=null,this.abandonedWebSocket=!1,this.startWebSocketSlowTimer(),this.startWebSocketGiveUpTimer(e),this.tryTransportWithFallbacks("web_socket",e,!0,t,(()=>!1!==this.wsCheckResult&&!this.abandonedWebSocket))}connectBase(e,t){x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.connectBase()"),this.baseTransport?this.tryTransportWithFallbacks(this.baseTransport,e,!1,t,(()=>!0)):this.notifyState({state:"disconnected",error:new _("No transports left to try",8e4,404)})}tryTransportWithFallbacks(e,t,n,r,i){x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.tryTransportWithFallbacks()",e);const o=e=>{this.notifyState({state:this.states.connecting.failState,error:e})},a=n?this.wsHosts.slice():this.httpHosts.slice(),s=(e,t)=>{r===this.connectCounter&&(i()?t||e||c():t&&t.dispose())},u=a.shift();if(!u)return void o(new _("Unable to connect (no available host)",80003,404));t.host=u;const c=()=>{a.length?this.realtime.http.checkConnectivity?ie(this.realtime.http.checkConnectivity(),((n,u)=>{r===this.connectCounter&&i()&&(n?o(n):u?(t.host=X(a),this.tryATransport(t,e,s)):o(new _("Unable to connect (network unreachable)",80003,404)))})):o(new P("Internal error: Http.checkConnectivity not set",null,500)):o(new _("Unable to connect (and no more fallback hosts to try)",80003,404))};if(this.forceFallbackHost&&a.length)return this.forceFallbackHost=!1,void c();this.tryATransport(t,e,s)}closeImpl(){x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.closeImpl()","closing connection"),this.cancelSuspendTimer(),this.startTransitionTimer(this.states.closing),this.pendingTransport&&(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.closeImpl()","Closing pending transport: "+this.pendingTransport),this.pendingTransport.close()),this.activeProtocol&&(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.closeImpl()","Closing active transport: "+this.activeProtocol.getTransport()),this.activeProtocol.getTransport().close()),this.notifyState({state:"closed"})}onAuthUpdated(e,t){var n;switch(this.state.state){case"connected":{x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.onAuthUpdated()","Sending AUTH message on active transport");const r=null==(n=this.activeProtocol)?void 0:n.getTransport();r&&r.onAuthUpdated&&r.onAuthUpdated(e);const i=an({action:Gt.AUTH,auth:{accessToken:e.token}});this.send(i);const o=()=>{this.off(a),t(null,e)},a=e=>{"failed"===e.current&&(this.off(o),this.off(a),t(e.reason||this.getStateError()))};this.once("connectiondetails",o),this.on("connectionstate",a);break}case"connecting":x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.onAuthUpdated()","Aborting current connection attempts in order to start again with the new auth details"),this.disconnectAllTransports();default:{x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.onAuthUpdated()","Connection state is "+this.state.state+"; waiting until either connected or failed");const n=r=>{switch(r.current){case"connected":this.off(n),t(null,e);break;case"failed":case"closed":case"suspended":this.off(n),t(r.reason||this.getStateError())}};this.on("connectionstate",n),"connecting"===this.state.state?this.startConnect():this.requestState({state:"connecting"})}}}disconnectAllTransports(){x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.disconnectAllTransports()","Disconnecting all transports"),this.connectCounter++,this.pendingTransport&&(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.disconnectAllTransports()","Disconnecting pending transport: "+this.pendingTransport),this.pendingTransport.disconnect()),delete this.pendingTransport,this.proposedTransport&&(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.disconnectAllTransports()","Disconnecting proposed transport: "+this.pendingTransport),this.proposedTransport.disconnect()),delete this.pendingTransport,this.activeProtocol&&(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.disconnectAllTransports()","Disconnecting active transport: "+this.activeProtocol.getTransport()),this.activeProtocol.getTransport().disconnect())}send(e,t,n){n=n||Sn;const r=this.state;if(r.sendEvents)return x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.send()","sending event"),void this.sendImpl(new pn(e,n));if(!t||!r.queueEvents){const e="rejecting event, queueEvent was "+t+", state was "+r.state;return x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.send()",e),void n(this.errorReason||new _(e,9e4,400))}this.logger.shouldLog(x.LOG_MICRO)&&x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.send()","queueing msg; "+sn(e,this.realtime._RealtimePresence)),this.queue(e,n)}sendImpl(e){const t=e.message;e.ackRequired&&!e.sendAttempted&&(t.msgSerial=this.msgSerial++);try{this.activeProtocol.send(e)}catch(e){x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.sendImpl()","Unexpected exception in transport.send(): "+e.stack)}}queue(e,t){x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.queue()","queueing event");const n=this.queuedMessages.last(),r=this.options.maxMessageSize;n&&!n.sendAttempted&&function(e,t,n){let r;if(e.channel!==t.channel)return!1;if((r=e.action)!==Gt.PRESENCE&&r!==Gt.MESSAGE)return!1;if(r!==t.action)return!1;const i=r===Gt.PRESENCE?"presence":"messages",o=e[i].concat(t[i]);return!(xt(o)>n||!V(o,"clientId")||!o.every((function(e){return!e.id}))||(e[i]=o,0))}(n.message,e,r)?(n.merged||(n.callback=Re.create(this.logger,[n.callback]),n.merged=!0),n.callback.push(t)):this.queuedMessages.push(new pn(e,t))}sendQueuedMessages(){let e;for(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.sendQueuedMessages()","sending "+this.queuedMessages.count()+" queued messages");e=this.queuedMessages.shift();)this.sendImpl(e)}queuePendingMessages(e){e&&e.length&&(x.logAction(this.logger,x.LOG_MICRO,"ConnectionManager.queuePendingMessages()","queueing "+e.length+" pending messages"),this.queuedMessages.prepend(e))}failQueuedMessages(e){const t=this.queuedMessages.count();t>0&&(x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.failQueuedMessages()","failing "+t+" queued messages, err = "+K(e)),this.queuedMessages.completeAllMessages(e))}onChannelMessage(e,t){this.pendingChannelMessagesState.queue.push({message:e,transport:t}),this.pendingChannelMessagesState.isProcessing||this.processNextPendingChannelMessage()}processNextPendingChannelMessage(){if(this.pendingChannelMessagesState.queue.length>0){this.pendingChannelMessagesState.isProcessing=!0;const e=this.pendingChannelMessagesState.queue.shift();this.processChannelMessage(e.message).catch((e=>{x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.processNextPendingChannelMessage() received error ",e)})).finally((()=>{this.pendingChannelMessagesState.isProcessing=!1,this.processNextPendingChannelMessage()}))}}async processChannelMessage(e){await this.realtime.channels.processChannelMessage(e)}async ping(){var e;if("connected"!==this.state.state)throw new _("Unable to ping service; not connected",4e4,400);const t=null==(e=this.activeProtocol)?void 0:e.getTransport();if(!t)throw this.getStateError();x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.ping()","transport = "+t);const n=Date.now(),r=te();return be(new Promise((e=>{const i=o=>{o===r&&(t.off("heartbeat",i),e(Date.now()-n))};t.on("heartbeat",i),t.ping(r)})),this.options.timeouts.realtimeRequestTimeout,"Timeout waiting for heartbeat response")}abort(e){this.activeProtocol.getTransport().fail(e)}getTransportPreference(){var e,t;return this.transportPreference||xn()&&(null==(t=null==(e=g.WebStorage)?void 0:e.get)?void 0:t.call(e,_n))}persistTransportPreference(e){var t,n;this.transportPreference=e.shortName,xn()&&(null==(n=null==(t=g.WebStorage)?void 0:t.set)||n.call(t,_n,e.shortName))}unpersistTransportPreference(){var e,t;this.transportPreference=null,xn()&&(null==(t=null==(e=g.WebStorage)?void 0:e.remove)||t.call(e,_n))}actOnErrorFromAuthorize(e){if(40171===e.code)this.notifyState({state:"failed",error:e});else if(40102===e.code)this.notifyState({state:"failed",error:e});else if(e.statusCode===Me.Forbidden){const t="Client configured authentication provider returned 403; failing the connection";x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.actOnErrorFromAuthorize()",t),this.notifyState({state:"failed",error:new _(t,80019,403,e)})}else{const t="Client configured authentication provider request failed";x.logAction(this.logger,x.LOG_MINOR,"ConnectionManager.actOnErrorFromAuthorize",t),this.notifyState({state:this.state.failState,error:new _(t,80019,401,e)})}}onConnectionDetailsUpdate(e,t){if(!e)return;this.connectionDetails=e,e.maxMessageSize&&(this.options.maxMessageSize=e.maxMessageSize);const n=e.clientId;if(n){const e=this.realtime.auth._uncheckedSetClientId(n);if(e)return x.logAction(this.logger,x.LOG_ERROR,"ConnectionManager.onConnectionDetailsUpdate()",e.message),void t.fail(e)}const r=e.connectionStateTtl;r&&(this.connectionStateTtl=r),this.maxIdleInterval=e.maxIdleInterval,this.emit("connectiondetails",e)}checkWsConnectivity(){const e=this.options.wsConnectivityCheckUrl||Ae.wsConnectivityCheckUrl,t=new g.Config.WebSocket(e);return new Promise(((e,n)=>{let r=!1;t.onopen=()=>{r||(r=!0,e(),t.close())},t.onclose=t.onerror=()=>{r||(r=!0,n())}}))}sessionRecoveryName(){return this.options.recoveryKeyStorageName||"ably-connection-recovery"}getSessionRecoverData(){var e,t;return kn()&&(null==(t=null==(e=g.WebStorage)?void 0:e.getSession)?void 0:t.call(e,this.sessionRecoveryName()))}setSessionRecoverData(e){var t,n;return kn()&&(null==(n=null==(t=g.WebStorage)?void 0:t.setSession)?void 0:n.call(t,this.sessionRecoveryName(),e))}clearSessionRecoverData(){var e,t;return kn()&&(null==(t=null==(e=g.WebStorage)?void 0:e.removeSession)?void 0:t.call(e,this.sessionRecoveryName()))}},Tn=class extends Yt{constructor(e,t){super(e.logger),this.whenState=e=>Yt.prototype.whenState.call(this,e,this.state),this.ably=e,this.connectionManager=new En(e,t),this.state=this.connectionManager.state.state,this.key=void 0,this.id=void 0,this.errorReason=null,this.connectionManager.on("connectionstate",(e=>{const t=this.state=e.current;g.Config.nextTick((()=>{this.emit(t,e)}))})),this.connectionManager.on("update",(e=>{g.Config.nextTick((()=>{this.emit("update",e)}))}))}connect(){x.logAction(this.logger,x.LOG_MINOR,"Connection.connect()",""),this.connectionManager.requestState({state:"connecting"})}async ping(){return x.logAction(this.logger,x.LOG_MINOR,"Connection.ping()",""),this.connectionManager.ping()}close(){x.logAction(this.logger,x.LOG_MINOR,"Connection.close()","connectionKey = "+this.key),this.connectionManager.requestState({state:"closing"})}get recoveryKey(){return this.logger.deprecationWarning("The `Connection.recoveryKey` attribute has been replaced by the `Connection.createRecoveryKey()` method. Replace your usage of `recoveryKey` with the return value of `createRecoveryKey()`. `recoveryKey` will be removed in a future version."),this.createRecoveryKey()}createRecoveryKey(){return this.connectionManager.createRecoveryKey()}},jn=class{constructor(e,t,n,r,i){this.previous=e,this.current=t,"attached"===t&&(this.resumed=n,this.hasBacklog=r),i&&(this.reason=i)}},Cn=function(){};function An(e){const t=e||{},{agent:n}=t;return((e,t)=>{var n={};for(var r in e)l.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&c)for(var r of c(e))t.indexOf(r)<0&&f.call(e,r)&&(n[r]=e[r]);return n})(t,["agent"])}var Rn=class e extends Yt{constructor(e,t,n){var r,i;super(e.logger),this.retryCount=0,this.history=async function(e){x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.history()","channel = "+this.name);const t=this.client.rest.channelMixin;if(e&&e.untilAttach){if("attached"!==this.state)throw new _("option untilAttach requires the channel to be attached",4e4,400);if(!this.properties.attachSerial)throw new _("untilAttach was specified and channel is attached, but attachSerial is not defined",4e4,400);delete e.untilAttach,e.from_serial=this.properties.attachSerial}return t.history(this,e)},this.whenState=e=>Yt.prototype.whenState.call(this,e,this.state),x.logAction(this.logger,x.LOG_MINOR,"RealtimeChannel()","started; name = "+t),this.name=t,this.channelOptions=Ee(null!=(r=e._Crypto)?r:null,this.logger,n),this.client=e,this._presence=e._RealtimePresence?new e._RealtimePresence.RealtimePresence(this):null,this.connectionManager=e.connection.connectionManager,this.state="initialized",this.subscriptions=new Yt(this.logger),this.syncChannelSerial=void 0,this.properties={attachSerial:void 0,channelSerial:void 0},this.setOptions(n),this.errorReason=null,this._requestedFlags=null,this._mode=null,this._attachResume=!1,this._decodingContext={channelOptions:this.channelOptions,plugins:e.options.plugins||{},baseEncodedPreviousPayload:void 0},this._lastPayload={messageId:null,protocolMessageChannelSerial:null,decodeFailureRecoveryInProgress:null},this._allChannelChanges=new Yt(this.logger),(null==(i=e.options.plugins)?void 0:i.Push)&&(this._push=new e.options.plugins.Push.PushChannel(this))}get presence(){return this._presence||ye("RealtimePresence"),this._presence}get push(){return this._push||ye("Push"),this._push}invalidStateError(){return new _("Channel operation failed as channel state is "+this.state,90001,400,this.errorReason||void 0)}static processListenerArgs(e){return"function"==typeof(e=Array.prototype.slice.call(e))[0]&&e.unshift(null),e}async setOptions(e){var t;const n=this.channelOptions,r=function(e){if(e&&"params"in e&&!C(e.params))return new _("options.params must be an object",4e4,400);if(e&&"modes"in e){if(!Array.isArray(e.modes))return new _("options.modes must be an array",4e4,400);for(let t=0;t{this._allChannelChanges.once(["attached","update","detached","failed"],(function(n){switch(this.event){case"update":case"attached":e();break;default:t(n.reason)}}))}))}_shouldReattachToSetOptions(e,t){if("attached"!==this.state&&"attaching"!==this.state)return!1;if(null==e?void 0:e.params){const n=An(e.params),r=An(t.params);if(Object.keys(n).length!==Object.keys(r).length)return!0;if(!pe(r,n))return!0}return!(!(null==e?void 0:e.modes)||t.modes&&ve(e.modes,t.modes))}async publish(...e){let t=e[0],n=e.length;if(!this.connectionManager.activeState())throw this.connectionManager.getError();if(1==n)if(C(t))t=[bt(t)];else{if(!Array.isArray(t))throw new _("The single-argument form of publish() expects a message object or an array of message objects",40013,400);t=wt(t)}else t=[bt({name:e[0],data:e[1]})];const r=this.client.options.maxMessageSize;await vt(t,this.channelOptions);const i=xt(t);if(i>r)throw new _("Maximum size of messages that can be published at once exceeded ( was "+i+" bytes; limit is "+r+" bytes)",40009,400);return new Promise(((e,n)=>{this._publish(t,(t=>t?n(t):e()))}))}_publish(e,t){x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.publish()","message count = "+e.length);const n=this.state;switch(n){case"failed":case"suspended":t(_.fromValues(this.invalidStateError()));break;default:{x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.publish()","sending message; channel state is "+n);const r=new fn;r.action=Gt.MESSAGE,r.channel=this.name,r.messages=e,this.sendMessage(r,t);break}}}onEvent(e){x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.onEvent()","received message");const t=this.subscriptions;for(let n=0;n{this._attach(!1,null,((n,r)=>n?t(n):e(r)))}))}_attach(e,t,n){n||(n=e=>{e&&x.logAction(this.logger,x.LOG_ERROR,"RealtimeChannel._attach()","Channel attach failed: "+e.toString())});const r=this.connectionManager;r.activeState()?(("attaching"!==this.state||e)&&this.requestState("attaching",t),this.once((function(e){switch(this.event){case"attached":null==n||n(null,e);break;case"detached":case"suspended":case"failed":null==n||n(e.reason||r.getError()||new _("Unable to attach; reason unknown; state = "+this.event,9e4,500));break;case"detaching":null==n||n(new _("Attach request superseded by a subsequent detach request",9e4,409))}}))):n(r.getError())}attachImpl(){x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.attachImpl()","sending ATTACH message");const e=an({action:Gt.ATTACH,channel:this.name,params:this.channelOptions.params,channelSerial:this.properties.channelSerial});this._requestedFlags?e.encodeModesToFlags(this._requestedFlags):this.channelOptions.modes&&e.encodeModesToFlags(ue(this.channelOptions.modes)),this._attachResume&&e.setFlag("ATTACH_RESUME"),this._lastPayload.decodeFailureRecoveryInProgress&&(e.channelSerial=this._lastPayload.protocolMessageChannelSerial),this.sendMessage(e,Cn)}async detach(){const e=this.connectionManager;if(!e.activeState())throw e.getError();switch(this.state){case"suspended":return void this.notifyState("detached");case"detached":return;case"failed":throw new _("Unable to detach; channel state = failed",90001,400);default:this.requestState("detaching");case"detaching":return new Promise(((t,n)=>{this.once((function(r){switch(this.event){case"detached":t();break;case"attached":case"suspended":case"failed":n(r.reason||e.getError()||new _("Unable to detach; reason unknown; state = "+this.event,9e4,500));break;case"attaching":n(new _("Detach request superseded by a subsequent attach request",9e4,409))}}))}))}}detachImpl(e){x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.detach()","sending DETACH message");const t=an({action:Gt.DETACH,channel:this.name});this.sendMessage(t,e||Cn)}async subscribe(...t){const[n,r]=e.processListenerArgs(t);if("failed"===this.state)throw _.fromValues(this.invalidStateError());return n&&"object"==typeof n&&!Array.isArray(n)?this.client._FilteredSubscriptions.subscribeFilter(this,n,r):this.subscriptions.on(n,r),this.attach()}unsubscribe(...t){var n;const[r,i]=e.processListenerArgs(t);"object"==typeof r&&!i||(null==(n=this.filteredSubscriptions)?void 0:n.has(i))?this.client._FilteredSubscriptions.getAndDeleteFilteredSubscriptions(this,r,i).forEach((e=>this.subscriptions.off(e))):this.subscriptions.off(r,i)}sync(){switch(this.state){case"initialized":case"detaching":case"detached":throw new P("Unable to sync to channel; not attached",4e4)}const e=this.connectionManager;if(!e.activeState())throw e.getError();const t=an({action:Gt.SYNC,channel:this.name});this.syncChannelSerial&&(t.channelSerial=this.syncChannelSerial),e.send(t)}sendMessage(e,t){this.connectionManager.send(e,this.client.options.queueMessages,t)}sendPresence(e,t){const n=an({action:Gt.PRESENCE,channel:this.name,presence:Array.isArray(e)?this.client._RealtimePresence.presenceMessagesFromValuesArray(e):[this.client._RealtimePresence.presenceMessageFromValues(e)]});this.sendMessage(n,t)}async processMessage(e){e.action!==Gt.ATTACHED&&e.action!==Gt.MESSAGE&&e.action!==Gt.PRESENCE||this.setChannelSerial(e.channelSerial);let t,n=!1;switch(e.action){case Gt.ATTACHED:{this.properties.attachSerial=e.channelSerial,this._mode=e.getMode(),this.params=e.params||{};const t=e.decodeModesFromFlags();this.modes=t&&se(t)||void 0;const n=e.hasFlag("RESUMED"),r=e.hasFlag("HAS_PRESENCE"),i=e.hasFlag("HAS_BACKLOG");if("attached"===this.state){n||this._presence&&this._presence.onAttached(r);const t=new jn(this.state,this.state,n,i,e.error);this._allChannelChanges.emit("update",t),n&&!this.channelOptions.updateOnAttached||this.emit("update",t)}else"detaching"===this.state?this.checkPendingState():this.notifyState("attached",e.error,n,r,i);break}case Gt.DETACHED:{const t=e.error?_.fromValues(e.error):new _("Channel detached",90001,404);"detaching"===this.state?this.notifyState("detached",t):"attaching"===this.state?this.notifyState("suspended",t):"attached"!==this.state&&"suspended"!==this.state||this.requestState("attaching",t);break}case Gt.SYNC:if(n=!0,t=this.syncChannelSerial=e.channelSerial,!e.presence)break;case Gt.PRESENCE:{const r=e.presence;if(!r)break;const i=this.channelOptions;await this._decodeAndPrepareMessages(e,r,(e=>Ct(e,i))),this._presence&&this._presence.setPresence(r,n,t);break}case Gt.MESSAGE:{if("attached"!==this.state)return void x.logAction(this.logger,x.LOG_MAJOR,"RealtimeChannel.processMessage()",'Message "'+e.id+'" skipped as this channel "'+this.name+'" state is not "attached" (state is "'+this.state+'").');const t=e.messages,n=t[0],r=t[t.length-1],i=e.channelSerial;if(n.extras&&n.extras.delta&&n.extras.delta.from!==this._lastPayload.messageId){const t='Delta message decode failure - previous message not available for message "'+e.id+'" on this channel "'+this.name+'".';x.logAction(this.logger,x.LOG_ERROR,"RealtimeChannel.processMessage()",t),this._startDecodeFailureRecovery(new _(t,40018,400));break}const{unrecoverableError:o}=await this._decodeAndPrepareMessages(e,t,(e=>yt(e,this._decodingContext)),(e=>{const t=e;switch(t.code){case 40018:return this._startDecodeFailureRecovery(t),{unrecoverableError:!0};case 40019:case 40021:return this.notifyState("failed",t),{unrecoverableError:!0};default:return{unrecoverableError:!1}}}));if(o)return;for(let e=0;e{this._lastPayload.decodeFailureRecoveryInProgress=!1})))}onAttached(){x.logAction(this.logger,x.LOG_MINOR,"RealtimeChannel.onAttached","activating channel; name = "+this.name)}notifyState(e,t,n,r,i){if(x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.notifyState","name = "+this.name+", current state = "+this.state+", notifying state "+e),this.clearStateTimer(),["detached","suspended","failed"].includes(e)&&(this.properties.channelSerial=null),e===this.state)return;this._presence&&this._presence.actOnChannelState(e,r,t),"suspended"===e&&this.connectionManager.state.sendEvents?this.startRetryTimer():this.cancelRetryTimer(),t&&(this.errorReason=t);const o=new jn(this.state,e,n,i,t),a='Channel state for channel "'+this.name+'"',s=e+(t?"; reason: "+t:"");"failed"===e?x.logAction(this.logger,x.LOG_ERROR,a,s):x.logAction(this.logger,x.LOG_MAJOR,a,s),"attaching"!==e&&"suspended"!==e&&(this.retryCount=0),"attached"===e&&this.onAttached(),"attached"===e?this._attachResume=!0:"detaching"!==e&&"failed"!==e||(this._attachResume=!1),this.state=e,this._allChannelChanges.emit(e,o),this.emit(e,o)}requestState(e,t){x.logAction(this.logger,x.LOG_MINOR,"RealtimeChannel.requestState","name = "+this.name+", state = "+e),this.notifyState(e,t),this.checkPendingState()}checkPendingState(){if(this.connectionManager.state.sendEvents)switch(x.logAction(this.logger,x.LOG_MINOR,"RealtimeChannel.checkPendingState","name = "+this.name+", state = "+this.state),this.state){case"attaching":this.startStateTimerIfNotRunning(),this.attachImpl();break;case"detaching":this.startStateTimerIfNotRunning(),this.detachImpl();break;case"attached":this.sync()}else x.logAction(this.logger,x.LOG_MINOR,"RealtimeChannel.checkPendingState","sendEvents is false; state is "+this.connectionManager.state.state)}timeoutPendingState(){switch(this.state){case"attaching":{const e=new _("Channel attach timed out",90007,408);this.notifyState("suspended",e);break}case"detaching":{const e=new _("Channel detach timed out",90007,408);this.notifyState("attached",e);break}default:this.checkPendingState()}}startStateTimerIfNotRunning(){this.stateTimer||(this.stateTimer=setTimeout((()=>{x.logAction(this.logger,x.LOG_MINOR,"RealtimeChannel.startStateTimerIfNotRunning","timer expired"),this.stateTimer=null,this.timeoutPendingState()}),this.client.options.timeouts.realtimeRequestTimeout))}clearStateTimer(){const e=this.stateTimer;e&&(clearTimeout(e),this.stateTimer=null)}startRetryTimer(){if(this.retryTimer)return;this.retryCount++;const e=fe(this.client.options.timeouts.channelRetryTimeout,this.retryCount);this.retryTimer=setTimeout((()=>{"suspended"===this.state&&this.connectionManager.state.sendEvents&&(this.retryTimer=null,x.logAction(this.logger,x.LOG_MINOR,"RealtimeChannel retry timer expired","attempting a new attach"),this.requestState("attaching"))}),e)}cancelRetryTimer(){this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null)}getReleaseErr(){const e=this.state;return"initialized"===e||"detached"===e||"failed"===e?null:new _("Can only release a channel in a state where there is no possibility of further updates from the server being received (initialized, detached, or failed); was "+e,90001,400)}setChannelSerial(e){x.logAction(this.logger,x.LOG_MICRO,"RealtimeChannel.setChannelSerial()","Updating channel serial; serial = "+e+"; previous = "+this.properties.channelSerial),e&&(this.properties.channelSerial=e)}async status(){return this.client.rest.channelMixin.status(this)}},$n=class e extends Xe{constructor(t){var n,r;if(super(Ae.objectifyOptions(t,!1,"BaseRealtime",x.defaultLogger)),x.logAction(this.logger,x.LOG_MINOR,"Realtime()",""),"string"==typeof EdgeRuntime)throw new _('Ably.Realtime instance cannot be used in Vercel Edge runtime. If you are running Vercel Edge functions, please replace your "new Ably.Realtime()" with "new Ably.Rest()" and use Ably Rest API instead of the Realtime API. If you are server-rendering your application in the Vercel Edge runtime, please use the condition "if (typeof EdgeRuntime === \'string\')" to prevent instantiating Ably.Realtime instance during SSR in the Vercel Edge runtime.',4e4,400);this._additionalTransportImplementations=e.transportImplementationsFromPlugins(this.options.plugins),this._RealtimePresence=null!=(r=null==(n=this.options.plugins)?void 0:n.RealtimePresence)?r:null,this.connection=new Tn(this,this.options),this._channels=new In(this),!1!==this.options.autoConnect&&this.connect()}static transportImplementationsFromPlugins(e){const t={};return(null==e?void 0:e.WebSocketTransport)&&(t[un.WebSocket]=e.WebSocketTransport),(null==e?void 0:e.XHRPolling)&&(t[un.XhrPolling]=e.XHRPolling),t}get channels(){return this._channels}connect(){x.logAction(this.logger,x.LOG_MINOR,"Realtime.connect()",""),this.connection.connect()}close(){x.logAction(this.logger,x.LOG_MINOR,"Realtime.close()",""),this.connection.close()}};$n.EventEmitter=Yt;var Qn=$n,In=class extends Yt{constructor(e){super(e.logger),this.realtime=e,this.all=Object.create(null),e.connection.connectionManager.on("transport.active",(()=>{this.onTransportActive()}))}channelSerials(){let e={};for(const t of U(this.all,!0)){const n=this.all[t];n.properties.channelSerial&&(e[t]=n.properties.channelSerial)}return e}recoverChannels(e){for(const t of U(e,!0))this.get(t).properties.channelSerial=e[t]}async processChannelMessage(e){const t=e.channel;if(void 0===t)return void x.logAction(this.logger,x.LOG_ERROR,"Channels.processChannelMessage()","received event unspecified channel, action = "+e.action);const n=this.all[t];n?await n.processMessage(e):x.logAction(this.logger,x.LOG_ERROR,"Channels.processChannelMessage()","received event for non-existent channel: "+t)}onTransportActive(){for(const e in this.all){const t=this.all[e];"attaching"===t.state||"detaching"===t.state?t.checkPendingState():"suspended"===t.state?t._attach(!1,null):"attached"===t.state&&t.requestState("attaching")}}propogateConnectionInterruption(e,t){const n=["attaching","attached","detaching","suspended"],r={closing:"detached",closed:"detached",failed:"failed",suspended:"suspended"}[e];for(const e in this.all){const i=this.all[e];n.includes(i.state)&&i.notifyState(r,t)}}get(e,t){e=String(e);let n=this.all[e];if(n){if(t){if(n._shouldReattachToSetOptions(t,n.channelOptions))throw new _("Channels.get() cannot be used to set channel options that would cause the channel to reattach. Please, use RealtimeChannel.setOptions() instead.",4e4,400);n.setOptions(t)}}else n=this.all[e]=new Rn(this.realtime,e,t);return n}getDerived(e,t,n){if(t.filter){const n=me(t.filter),r=de(e);e=`[filter=${n}${r.qualifierParam}]${r.channelName}`}return this.get(e,n)}release(e){e=String(e);const t=this.all[e];if(!t)return;const n=t.getReleaseErr();if(n)throw n;delete this.all[e]}},Mn=Qn;function Dn(e,t){if(e.isSynthesized()||t.isSynthesized())return e.timestamp>=t.timestamp;const n=e.parseId(),r=t.parseId();return n.msgSerial===r.msgSerial?n.index>r.index:n.msgSerial>r.msgSerial}var Nn=class extends Yt{constructor(e,t,n=Dn){super(e.logger),this.presence=e,this.map=Object.create(null),this.syncInProgress=!1,this.residualMembers=null,this.memberKey=t,this.newerThan=n}get(e){return this.map[e]}getClient(e){const t=this.map,n=[];for(const r in t){const i=t[r];i.clientId==e&&"absent"!=i.action&&n.push(i)}return n}list(e){const t=this.map,n=e&&e.clientId,r=e&&e.connectionId,i=[];for(const e in t){const o=t[e];"absent"!==o.action&&(n&&n!=o.clientId||r&&r!=o.connectionId||i.push(o))}return i}put(e){"enter"!==e.action&&"update"!==e.action||((e=Tt(e)).action="present");const t=this.map,n=this.memberKey(e);this.residualMembers&&delete this.residualMembers[n];const r=t[n];return!(r&&!this.newerThan(e,r)||(t[n]=e,0))}values(){const e=this.map,t=[];for(const n in e){const r=e[n];"absent"!=r.action&&t.push(r)}return t}remove(e){const t=this.map,n=this.memberKey(e),r=t[n];return!(r&&!this.newerThan(e,r)||(this.syncInProgress?((e=Tt(e)).action="absent",t[n]=e):delete t[n],!r))}startSync(){const e=this.map,t=this.syncInProgress;x.logAction(this.logger,x.LOG_MINOR,"PresenceMap.startSync()","channel = "+this.presence.channel.name+"; syncInProgress = "+t),this.syncInProgress||(this.residualMembers=T(e),this.setInProgress(!0))}endSync(){const e=this.map,t=this.syncInProgress;if(x.logAction(this.logger,x.LOG_MINOR,"PresenceMap.endSync()","channel = "+this.presence.channel.name+"; syncInProgress = "+t),t){for(const t in e)"absent"===e[t].action&&delete e[t];this.presence._synthesizeLeaves(B(this.residualMembers));for(const t in this.residualMembers)delete e[t];this.residualMembers=null,this.setInProgress(!1)}this.emit("sync")}waitSync(e){const t=this.syncInProgress;x.logAction(this.logger,x.LOG_MINOR,"PresenceMap.waitSync()","channel = "+this.presence.channel.name+"; syncInProgress = "+t),t?this.once("sync",e):e()}clear(){this.map={},this.setInProgress(!1),this.residualMembers=null}setInProgress(e){x.logAction(this.logger,x.LOG_MICRO,"PresenceMap.setInProgress()","inProgress = "+e),this.syncInProgress=e,this.presence.syncComplete=!e}};function Fn(e){const t=e.channel.client,n=t.auth.clientId;return(!n||"*"===n)&&"connected"===t.connection.state}var Ln=class extends Yt{constructor(e){super(e.logger),this.channel=e,this.syncComplete=!1,this.members=new Nn(this,(e=>e.clientId+":"+e.connectionId)),this._myMembers=new Nn(this,(e=>e.clientId)),this.subscriptions=new Yt(this.logger),this.pendingPresence=[]}async enter(e){if(Fn(this))throw new _("clientId must be specified to enter a presence channel",40012,400);return this._enterOrUpdateClient(void 0,void 0,e,"enter")}async update(e){if(Fn(this))throw new _("clientId must be specified to update presence data",40012,400);return this._enterOrUpdateClient(void 0,void 0,e,"update")}async enterClient(e,t){return this._enterOrUpdateClient(void 0,e,t,"enter")}async updateClient(e,t){return this._enterOrUpdateClient(void 0,e,t,"update")}async _enterOrUpdateClient(e,t,n,r){const i=this.channel;if(!i.connectionManager.activeState())throw i.connectionManager.getError();x.logAction(this.logger,x.LOG_MICRO,"RealtimePresence."+r+"Client()","channel = "+i.name+", id = "+e+", client = "+(t||"(implicit) "+this.channel.client.auth.clientId));const o=Rt(n);switch(o.action=r,e&&(o.id=e),t&&(o.clientId=t),await mt(o,i.channelOptions),i.state){case"attached":return new Promise(((e,t)=>{i.sendPresence(o,(n=>n?t(n):e()))}));case"initialized":case"detached":i.attach();case"attaching":return new Promise(((e,t)=>{this.pendingPresence.push({presence:o,callback:n=>n?t(n):e()})}));default:{const e=new P("Unable to "+r+" presence channel while in "+i.state+" state",90001);throw e.code=90001,e}}}async leave(e){if(Fn(this))throw new _("clientId must have been specified to enter or leave a presence channel",40012,400);return this.leaveClient(void 0,e)}async leaveClient(e,t){const n=this.channel;if(!n.connectionManager.activeState())throw n.connectionManager.getError();x.logAction(this.logger,x.LOG_MICRO,"RealtimePresence.leaveClient()","leaving; channel = "+this.channel.name+", client = "+e);const r=Rt(t);return r.action="leave",e&&(r.clientId=e),new Promise(((e,t)=>{switch(n.state){case"attached":n.sendPresence(r,(n=>n?t(n):e()));break;case"attaching":this.pendingPresence.push({presence:r,callback:n=>n?t(n):e()});break;case"initialized":case"failed":{const e=new P("Unable to leave presence channel (incompatible state)",90001);t(e);break}default:t(n.invalidStateError())}}))}async get(e){const t=!e||!("waitForSync"in e)||e.waitForSync;return new Promise(((n,r)=>{function i(t){n(e?t.list(e):t.values())}"suspended"!==this.channel.state?function(e,t,n){switch(e.state){case"attached":case"suspended":n();break;case"initialized":case"detached":case"detaching":case"attaching":ie(e.attach(),(function(e){e?t(e):n()}));break;default:t(_.fromValues(e.invalidStateError()))}}(this.channel,(e=>r(e)),(()=>{const e=this.members;t?e.waitSync((function(){i(e)})):i(e)})):t?r(_.fromValues({statusCode:400,code:91005,message:"Presence state is out of sync due to channel being in the SUSPENDED state"})):i(this.members)}))}async history(e){x.logAction(this.logger,x.LOG_MICRO,"RealtimePresence.history()","channel = "+this.name);const t=this.channel.client.rest.presenceMixin;if(e&&e.untilAttach){if("attached"!==this.channel.state)throw new _("option untilAttach requires the channel to be attached, was: "+this.channel.state,4e4,400);delete e.untilAttach,e.from_serial=this.channel.properties.attachSerial}return t.history(this,e)}setPresence(e,t,n){let r,i;x.logAction(this.logger,x.LOG_MICRO,"RealtimePresence.setPresence()","received presence for "+e.length+" participants; syncChannelSerial = "+n);const o=this.members,a=this._myMembers,s=[],u=this.channel.connectionManager.connectionId;t&&(this.members.startSync(),n&&(i=n.match(/^[\w-]+:(.*)$/))&&(r=i[1]));for(let t=0;t{const t=new _("Presence auto re-enter failed",91004,400,e);x.logAction(this.logger,x.LOG_ERROR,"RealtimePresence._ensureMyMembersPresent()","Presence auto re-enter failed; reason = "+K(e));const n=new jn(this.channel.state,this.channel.state,!0,!1,t);this.channel.emit("update",n)}))}}_synthesizeLeaves(e){const t=this.subscriptions;e.forEach((function(e){const n=Tt({action:"leave",connectionId:e.connectionId,clientId:e.clientId,data:e.data,encoding:e.encoding,timestamp:Date.now()});t.emit("leave",n)}))}async subscribe(...e){const t=Rn.processListenerArgs(e),n=t[0],r=t[1],i=this.channel;if("failed"===i.state)throw _.fromValues(i.invalidStateError());this.subscriptions.on(n,r),await i.attach()}unsubscribe(...e){const t=Rn.processListenerArgs(e),n=t[0],r=t[1];this.subscriptions.off(n,r)}},qn=un.WebSocket,zn=class extends On{constructor(e,t,n){super(e,t,n),this.shortName=qn,n.heartbeats=g.Config.useProtocolHeartbeats,this.wsHost=n.host}static isAvailable(){return!!g.Config.WebSocket}createWebSocket(e,t){return this.uri=e+Y(t),new g.Config.WebSocket(this.uri)}toString(){return"WebSocketTransport; uri="+this.uri}connect(){x.logAction(this.logger,x.LOG_MINOR,"WebSocketTransport.connect()","starting"),On.prototype.connect.call(this);const e=this,t=this.params,n=t.options,r=(n.tls?"wss://":"ws://")+this.wsHost+":"+Ae.getPort(n)+"/";x.logAction(this.logger,x.LOG_MINOR,"WebSocketTransport.connect()","uri: "+r),ie(this.auth.getAuthParams(),(function(n,i){if(e.isDisposed)return;let o="";for(const e in i)o+=" "+e+": "+i[e]+";";if(x.logAction(e.logger,x.LOG_MINOR,"WebSocketTransport.connect()","authParams:"+o+" err: "+n),n)return void e.disconnect(n);const a=t.getConnectParams(i);try{const t=e.wsConnection=e.createWebSocket(r,a);t.binaryType=g.Config.binaryType,t.onopen=function(){e.onWsOpen()},t.onclose=function(t){e.onWsClose(t)},t.onmessage=function(t){e.onWsData(t.data)},t.onerror=function(t){e.onWsError(t)},t.on&&t.on("ping",(function(){e.onActivity()}))}catch(t){x.logAction(e.logger,x.LOG_ERROR,"WebSocketTransport.connect()","Unexpected exception creating websocket: err = "+(t.stack||t.message)),e.disconnect(t)}}))}send(e){const t=this.wsConnection;if(t)try{t.send(nn(e,this.connectionManager.realtime._MsgPack,this.params.format))}catch(e){const t="Exception from ws connection when trying to send: "+K(e);x.logAction(this.logger,x.LOG_ERROR,"WebSocketTransport.send()",t),this.finish("disconnected",new _(t,5e4,500))}else x.logAction(this.logger,x.LOG_ERROR,"WebSocketTransport.send()","No socket connection")}onWsData(e){x.logAction(this.logger,x.LOG_MICRO,"WebSocketTransport.onWsData()","data received; length = "+e.length+"; type = "+typeof e);try{this.onProtocolMessage((t=e,n=this.connectionManager.realtime._MsgPack,r=this.connectionManager.realtime._RealtimePresence,i=this.format,rn(oe(t,n,i),r)))}catch(e){x.logAction(this.logger,x.LOG_ERROR,"WebSocketTransport.onWsData()","Unexpected exception handing channel message: "+e.stack)}var t,n,r,i}onWsOpen(){x.logAction(this.logger,x.LOG_MINOR,"WebSocketTransport.onWsOpen()","opened WebSocket"),this.emit("preconnect")}onWsClose(e){let t,n;if("object"==typeof e?(n=e.code,t=e.wasClean||1e3===n):(n=e,t=1e3==n),delete this.wsConnection,t){x.logAction(this.logger,x.LOG_MINOR,"WebSocketTransport.onWsClose()","Cleanly closed WebSocket");const e=new _("Websocket closed",80003,400);this.finish("disconnected",e)}else{const e="Unclean disconnection of WebSocket ; code = "+n,t=new _(e,80003,400);x.logAction(this.logger,x.LOG_MINOR,"WebSocketTransport.onWsClose()",e),this.finish("disconnected",t)}this.emit("disposed")}onWsError(e){x.logAction(this.logger,x.LOG_MINOR,"WebSocketTransport.onError()","Error from WebSocket: "+e.message),g.Config.nextTick((()=>{this.disconnect(Error(e.message))}))}dispose(){x.logAction(this.logger,x.LOG_MINOR,"WebSocketTransport.dispose()",""),this.isDisposed=!0;const e=this.wsConnection;e&&(e.onmessage=function(){},delete this.wsConnection,g.Config.nextTick((()=>{if(x.logAction(this.logger,x.LOG_MICRO,"WebSocketTransport.dispose()","closing websocket"),!e)throw new Error("WebSocketTransport.dispose(): wsConnection is not defined");e.close()})))}},Un=class{static subscribeFilter(e,t,n){const r=e=>{var r,i,o,a,s,u;const c={name:e.name,refTimeserial:null==(i=null==(r=e.extras)?void 0:r.ref)?void 0:i.timeserial,refType:null==(a=null==(o=e.extras)?void 0:o.ref)?void 0:a.type,isRef:!!(null==(u=null==(s=e.extras)?void 0:s.ref)?void 0:u.timeserial),clientId:e.clientId};Object.entries(t).find((([e,t])=>void 0!==t&&c[e]!==t))||n(e)};this.addFilteredSubscription(e,t,n,r),e.subscriptions.on(r)}static addFilteredSubscription(e,t,n,r){var i;if(e.filteredSubscriptions||(e.filteredSubscriptions=new Map),e.filteredSubscriptions.has(n)){const o=e.filteredSubscriptions.get(n);o.set(t,(null==(i=null==o?void 0:o.get(t))?void 0:i.concat(r))||[r])}else e.filteredSubscriptions.set(n,new Map([[t,[r]]]))}static getAndDeleteFilteredSubscriptions(e,t,n){if(!e.filteredSubscriptions)return[];if(!n&&t)return Array.from(e.filteredSubscriptions.entries()).map((([n,r])=>{var i;let o=r.get(t);return r.delete(t),0===r.size&&(null==(i=e.filteredSubscriptions)||i.delete(n)),o})).reduce(((e,t)=>t?e.concat(...t):e),[]);if(!n||!e.filteredSubscriptions.has(n))return[];const r=e.filteredSubscriptions.get(n);if(!t){const t=Array.from(r.values()).reduce(((e,t)=>e.concat(...t)),[]);return e.filteredSubscriptions.delete(n),t}let i=r.get(t);return r.delete(t),i||[]}},Bn=class e extends Mn{constructor(t){var n;const r=e._MsgPack;if(!r)throw new Error("Expected DefaultRealtime._MsgPack to have been set");super(Ae.objectifyOptions(t,!0,"Realtime",x.defaultLogger,d(p({},Ut),{Crypto:null!=(n=e.Crypto)?n:void 0,MsgPack:r,RealtimePresence:{RealtimePresence:Ln,presenceMessageFromValues:Tt,presenceMessagesFromValuesArray:At,presenceMessageFromWireProtocol:jt},WebSocketTransport:zn,MessageInteractions:Un})))}static get Crypto(){if(null===this._Crypto)throw new Error("Encryption not enabled; use ably.encryption.js instead");return this._Crypto}static set Crypto(e){this._Crypto=e}};Bn.Utils=k,Bn.ConnectionManager=En,Bn.ProtocolMessage=fn,Bn._Crypto=null,Bn.Message=Bt,Bn.PresenceMessage=Zt,Bn._MsgPack=null,Bn._Http=Ve,Bn._PresenceMap=Nn;var Zn=Bn,Vn=Uint8Array,Wn=Uint32Array,Xn=Math.pow,Yn=new Wn(8),Gn=[],Hn=new Wn(64);function Kn(e){return(e-(0|e))*Xn(2,32)|0}for(var Jn,er,tr=2,nr=0;nr<64;){for(Jn=!0,er=2;er<=tr/2;er++)tr%er==0&&(Jn=!1);Jn&&(nr<8&&(Yn[nr]=Kn(Xn(tr,.5))),Gn[nr]=Kn(Xn(tr,1/3)),nr++),tr++}var rr=!!new Vn(new Wn([1]).buffer)[0];function ir(e){return rr?e>>>24|(e>>>16&255)<<8|(65280&e)<<8|e<<24:e}function or(e,t){return e>>>t|e<<32-t}function ar(e){var t,n=Yn.slice(),r=e.length,i=8*r,o=512-(i+64)%512-1+i+65,a=new Vn(o/8),s=new Wn(a.buffer);a.set(e,0),a[r]=128,s[s.length-1]=ir(i);for(var u=0;u>>3)+(or(h,17)^or(h,19)^h>>>10)}Hn[t]=l|=0;for(var p=(or(c[4],6)^or(c[4],11)^or(c[4],25))+(c[4]&c[5]^~c[4]&c[6])+c[7]+l+Gn[t],d=(or(c[0],2)^or(c[0],13)^or(c[0],22))+(c[0]&c[1]^c[2]&(c[0]^c[1])),m=7;m>0;m--)c[m]=c[m-1];c[0]=p+d|0,c[4]=c[4]+p|0}for(t=0;t<8;t++)n[t]=n[t]+c[t]|0}return new Vn(new Wn(n.map((function(e){return ir(e)}))).buffer)}var sr,ur=new class{constructor(){this.base64CharSet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.hexCharSet="0123456789abcdef"}uint8ViewToBase64(e){let t="";const n=this.base64CharSet,r=e.byteLength,i=r%3,o=r-i;let a,s,u,c,l;for(let r=0;r>18,s=(258048&l)>>12,u=(4032&l)>>6,c=63&l,t+=n[a]+n[s]+n[u]+n[c];return 1==i?(l=e[o],a=(252&l)>>2,s=(3&l)<<4,t+=n[a]+n[s]+"=="):2==i&&(l=e[o]<<8|e[o+1],a=(64512&l)>>10,s=(1008&l)>>4,u=(15&l)<<2,t+=n[a]+n[s]+n[u]+"="),t}base64ToArrayBuffer(e){const t=null==atob?void 0:atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;ee+t.toString(16).padStart(2,"0")),"")}hexDecode(e){if(e.length%2!=0)throw new Error("Can't create a byte array from a hex string of odd length");const t=new Uint8Array(e.length/2);for(let n=0;n64&&(e=ar(e)),e.length<64){const t=new Uint8Array(64);t.set(e,0),e=t}for(var n=new Uint8Array(64),r=new Uint8Array(64),i=0;i<64;i++)n[i]=54^e[i],r[i]=92^e[i];var o=new Uint8Array(t.length+64);o.set(n,0),o.set(t,64);var a=new Uint8Array(96);return a.set(r,0),a.set(ar(o),64),ar(a)}(this.toBuffer(t),this.toBuffer(e));return this.toArrayBuffer(n)}},cr=(e=>(e[e.REQ_SEND=0]="REQ_SEND",e[e.REQ_RECV=1]="REQ_RECV",e[e.REQ_RECV_POLL=2]="REQ_RECV_POLL",e[e.REQ_RECV_STREAM=3]="REQ_RECV_STREAM",e))(cr||{}),lr=cr;function fr(){return new _("No HTTP request plugin provided. Provide at least one of the FetchRequest or XHRRequest plugins.",400,4e4)}var hr=((sr=class{constructor(e){var t;this.checksInProgress=null,this.checkConnectivity=void 0,this.supportsAuthHeaders=!1,this.supportsLinkHeaders=!1,this.client=null!=e?e:null;const n=(null==e?void 0:e.options.connectivityCheckUrl)||Ae.connectivityCheckUrl,r=null!=(t=null==e?void 0:e.options.connectivityCheckParams)?t:null,i=!(null==e?void 0:e.options.connectivityCheckUrl),o=p(p({},hr.bundledRequestImplementations),null==e?void 0:e._additionalHTTPRequestImplementations),a=o.XHRRequest,s=o.FetchRequest,u=!(!a&&!s);if(!u)throw fr();g.Config.xhrSupported&&a?(this.supportsAuthHeaders=!0,this.Request=async function(t,n,r,i,o){return new Promise((s=>{var u;const c=a.createRequest(n,r,i,o,lr.REQ_SEND,null!=(u=e&&e.options.timeouts)?u:null,this.logger,t);c.once("complete",((e,t,n,r,i)=>s({error:e,body:t,headers:n,unpacked:r,statusCode:i}))),c.exec()}))},(null==e?void 0:e.options.disableConnectivityCheck)?this.checkConnectivity=async function(){return!0}:this.checkConnectivity=async function(){var e;x.logAction(this.logger,x.LOG_MICRO,"(XHRRequest)Http.checkConnectivity()","Sending; "+n);const t=await this.doUri(Qe.Get,n,null,null,r);let o=!1;var a;return o=i?!t.error&&"yes"==(null==(e=t.body)?void 0:e.replace(/\n/,"")):!t.error&&(a=t.statusCode)>=200&&a<400,x.logAction(this.logger,x.LOG_MICRO,"(XHRRequest)Http.checkConnectivity()","Result: "+o),o}):g.Config.fetchSupported&&s?(this.supportsAuthHeaders=!0,this.Request=async(t,n,r,i,o)=>s(t,null!=e?e:null,n,r,i,o),this.checkConnectivity=async function(){var e;x.logAction(this.logger,x.LOG_MICRO,"(Fetch)Http.checkConnectivity()","Sending; "+n);const t=await this.doUri(Qe.Get,n,null,null,null),r=!t.error&&"yes"==(null==(e=t.body)?void 0:e.replace(/\n/,""));return x.logAction(this.logger,x.LOG_MICRO,"(Fetch)Http.checkConnectivity()","Result: "+r),r}):this.Request=async()=>({error:u?new P("no supported HTTP transports available",null,400):fr()})}get logger(){var e,t;return null!=(t=null==(e=this.client)?void 0:e.logger)?t:x.defaultLogger}async doUri(e,t,n,r,i){return this.Request?this.Request(e,t,n,i,r):{error:new P("Request invoked before assigned to",null,500)}}shouldFallback(e){const t=e.statusCode;return 408===t&&!e.code||400===t&&!e.code||t>=500&&t<=504}}).methods=[Qe.Get,Qe.Delete,Qe.Post,Qe.Put,Qe.Patch],sr.methodsWithoutBody=[Qe.Get,Qe.Delete],sr.methodsWithBody=[Qe.Post,Qe.Put,Qe.Patch],sr),pr=hr,dr="ablyjs-storage-test",mr=void 0!==t?t:"undefined"!=typeof window?window:self,vr=new class{constructor(){try{mr.sessionStorage.setItem(dr,dr),mr.sessionStorage.removeItem(dr),this.sessionSupported=!0}catch(e){this.sessionSupported=!1}try{mr.localStorage.setItem(dr,dr),mr.localStorage.removeItem(dr),this.localSupported=!0}catch(e){this.localSupported=!1}}get(e){return this._get(e,!1)}getSession(e){return this._get(e,!0)}remove(e){return this._remove(e,!1)}removeSession(e){return this._remove(e,!0)}set(e,t,n){return this._set(e,t,n,!1)}setSession(e,t,n){return this._set(e,t,n,!0)}_set(e,t,n,r){const i={value:t};return n&&(i.expires=Date.now()+n),this.storageInterface(r).setItem(e,JSON.stringify(i))}_get(e,t){if(t&&!this.sessionSupported)throw new Error("Session Storage not supported");if(!t&&!this.localSupported)throw new Error("Local Storage not supported");const n=this.storageInterface(t).getItem(e);if(!n)return null;const r=JSON.parse(n);return r.expires&&r.expires-1}(),useProtocolHeartbeats:!0,supportsBinary:!!gr.TextDecoder,preferBinary:!1,ArrayBuffer:gr.ArrayBuffer,atob:gr.atob,nextTick:void 0!==gr.setImmediate?gr.setImmediate.bind(gr):function(e){setTimeout(e,0)},addEventListener:gr.addEventListener,inspect:JSON.stringify,stringByteSize:function(e){return gr.TextDecoder&&(new gr.TextEncoder).encode(e).length||e.length},TextEncoder:gr.TextEncoder,TextDecoder:gr.TextDecoder,getRandomArrayBuffer:async function(e){const t=new Uint8Array(e);return gr.crypto.getRandomValues(t),t.buffer},isWebworker:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,push:{platform:"browser",formFactor:"desktop",storage:vr}};function Or(e){return function(e){const t=[80015,80017,80030];return!!e.code&&!Ue.isTokenErr(e)&&(!!t.includes(e.code)||e.code>=4e4&&e.code<5e4)}(e)?[an({action:Gt.ERROR,error:e})]:[an({action:Gt.DISCONNECTED,error:e})]}var wr=class extends On{constructor(e,t,n){super(e,t,n,!0),this.onAuthUpdated=e=>{this.authParams={access_token:e.token}},this.stream=!("stream"in n)||n.stream,this.sendRequest=null,this.recvRequest=null,this.pendingCallback=null,this.pendingItems=null}connect(){x.logAction(this.logger,x.LOG_MINOR,"CometTransport.connect()","starting"),On.prototype.connect.call(this);const e=this.params,t=e.options,n=Ae.getHost(t,e.host),r=Ae.getPort(t),i=t.tls?"https://":"http://";this.baseUri=i+n+":"+r+"/comet/";const o=this.baseUri+"connect";x.logAction(this.logger,x.LOG_MINOR,"CometTransport.connect()","uri: "+o),ie(this.auth.getAuthParams(),((e,t)=>{if(e)return void this.disconnect(e);if(this.isDisposed)return;this.authParams=t;const n=this.params.getConnectParams(t);"stream"in n&&(this.stream=n.stream),x.logAction(this.logger,x.LOG_MINOR,"CometTransport.connect()","connectParams:"+Y(n));let r=!1;const i=this.recvRequest=this.createRequest(o,null,n,null,this.stream?lr.REQ_RECV_STREAM:lr.REQ_RECV);i.on("data",(e=>{this.recvRequest&&(r||(r=!0,this.emit("preconnect")),this.onData(e))})),i.on("complete",(e=>{this.recvRequest||(e=e||new _("Request cancelled",80003,400)),this.recvRequest=null,r||e||(r=!0,this.emit("preconnect")),this.onActivity(),e?e.code?this.onData(Or(e)):this.disconnect(e):g.Config.nextTick((()=>{this.recv()}))})),i.exec()}))}requestClose(){x.logAction(this.logger,x.LOG_MINOR,"CometTransport.requestClose()"),this._requestCloseOrDisconnect(!0)}requestDisconnect(){x.logAction(this.logger,x.LOG_MINOR,"CometTransport.requestDisconnect()"),this._requestCloseOrDisconnect(!1)}_requestCloseOrDisconnect(e){const t=e?this.closeUri:this.disconnectUri;if(t){const n=this.createRequest(t,null,this.authParams,null,lr.REQ_SEND);n.on("complete",(t=>{t&&(x.logAction(this.logger,x.LOG_ERROR,"CometTransport.request"+(e?"Close()":"Disconnect()"),"request returned err = "+K(t)),this.finish("disconnected",t))})),n.exec()}}dispose(){x.logAction(this.logger,x.LOG_MINOR,"CometTransport.dispose()",""),this.isDisposed||(this.isDisposed=!0,this.recvRequest&&(x.logAction(this.logger,x.LOG_MINOR,"CometTransport.dispose()","aborting recv request"),this.recvRequest.abort(),this.recvRequest=null),this.finish("disconnected",gn.disconnected()),g.Config.nextTick((()=>{this.emit("disposed")})))}onConnect(e){var t;if(this.isDisposed)return;const n=null==(t=e.connectionDetails)?void 0:t.connectionKey;On.prototype.onConnect.call(this,e);const r=this.baseUri+n;x.logAction(this.logger,x.LOG_MICRO,"CometTransport.onConnect()","baseUri = "+r),this.sendUri=r+"/send",this.recvUri=r+"/recv",this.closeUri=r+"/close",this.disconnectUri=r+"/disconnect"}send(e){if(this.sendRequest)return this.pendingItems=this.pendingItems||[],void this.pendingItems.push(e);const t=this.pendingItems||[];t.push(e),this.pendingItems=null,this.sendItems(t)}sendAnyPending(){const e=this.pendingItems;e&&(this.pendingItems=null,this.sendItems(e))}sendItems(e){const t=this.sendRequest=this.createRequest(this.sendUri,null,this.authParams,this.encodeRequest(e),lr.REQ_SEND);t.on("complete",((e,t)=>{e&&x.logAction(this.logger,x.LOG_ERROR,"CometTransport.sendItems()","on complete: err = "+K(e)),this.sendRequest=null,e?e.code?this.onData(Or(e)):this.disconnect(e):(t&&this.onData(t),this.pendingItems&&g.Config.nextTick((()=>{this.sendRequest||this.sendAnyPending()})))})),t.exec()}recv(){if(this.recvRequest)return;if(!this.isConnected)return;const e=this.recvRequest=this.createRequest(this.recvUri,null,this.authParams,null,this.stream?lr.REQ_RECV_STREAM:lr.REQ_RECV_POLL);e.on("data",(e=>{this.onData(e)})),e.on("complete",(e=>{this.recvRequest=null,this.onActivity(),e?e.code?this.onData(Or(e)):this.disconnect(e):g.Config.nextTick((()=>{this.recv()}))})),e.exec()}onData(e){try{const t=this.decodeResponse(e);if(t&&t.length)for(let e=0;e{this.timedOut=!0,i.abort()}),t),r=this.method,i=this.xhr=new XMLHttpRequest,o=e.accept;let a=this.body,s="text";o?0===o.indexOf("application/x-msgpack")&&(s="arraybuffer"):e.accept="application/json",a&&(e["content-type"]||(e["content-type"]="application/json")).indexOf("application/json")>-1&&"string"!=typeof a&&(a=JSON.stringify(a)),i.open(r,this.uri,!0),i.responseType=s,"authorization"in e&&(i.withCredentials=!0);for(const t in e)i.setRequestHeader(t,e[t]);const u=(e,t,n,r)=>{var i;let o=t+" (event type: "+e.type+")";(null==(i=null==this?void 0:this.xhr)?void 0:i.statusText)&&(o+=", current statusText is "+this.xhr.statusText),x.logAction(this.logger,x.LOG_ERROR,"Request.on"+e.type+"()",o),this.complete(new P(o,n,r))};let c,l,f;i.onerror=function(e){u(e,"XHR error occurred",null,400)},i.onabort=e=>{this.timedOut?u(e,"Request aborted due to request timeout expiring",null,408):u(e,"Request cancelled",null,400)},i.ontimeout=function(e){u(e,"Request timed out",null,408)};let h=0,p=!1;const d=()=>{clearTimeout(n),f=l<400,204!=l?c=this.requestMode==lr.REQ_RECV_STREAM&&f&&function(e){return e.getResponseHeader&&(e.getResponseHeader("transfer-encoding")||!e.getResponseHeader("content-length"))}(i):this.complete(null,null,null,null,l)},m=()=>{let t;try{const n=function(e,t){return e.getResponseHeader&&e.getResponseHeader(t)}(i,"content-type");if(n?n.indexOf("application/json")>=0:"text"==i.responseType){const e="arraybuffer"===i.responseType?g.BufferUtils.utf8Decode(i.response):String(i.responseText);t=e.length?JSON.parse(e):e,p=!0}else t=i.response;void 0!==t.response?(l=t.statusCode,f=l<400,e=t.headers,t=t.response):e=function(e){const t=e.getAllResponseHeaders().trim().split("\r\n"),n={};for(let e=0;ee.trim()));n[r[0].toLowerCase()]=r[1]}return n}(i)}catch(e){return void this.complete(new P("Malformed response body from server: "+e.message,null,400))}if(f||Array.isArray(t))return void this.complete(null,t,e,p,l);let n=xr(t,e);n||(n=new P("Error response received from server: "+l+" body was: "+g.Config.inspect(t),null,l)),this.complete(n,t,e,p,l)};function v(){const e=i.responseText,t=e.length-1;let n,r;for(;h-1;)r=e.slice(h,n),h=n+1,y(r)}const y=e=>{try{e=JSON.parse(e)}catch(e){return void this.complete(new P("Malformed response body from server: "+e.message,null,400))}this.emit("data",e)},b=()=>{v(),this.streamComplete=!0,g.Config.nextTick((()=>{this.complete()}))};i.onreadystatechange=function(){const e=i.readyState;e<3||0!==i.status&&(void 0===l&&(l=i.status,d()),3==e&&c?v():4==e&&(c?b():m()))},i.send(a)}dispose(){const e=this.xhr;if(e){e.onreadystatechange=e.onerror=e.onabort=e.ontimeout=kr,this.xhr=null;const t=this.timer;t&&(clearTimeout(t),this.timer=null),this.requestComplete||e.abort()}delete _r[this.id]}},Er=un.XhrPolling,Tr={order:["xhr_polling"],bundledImplementations:{web_socket:zn,xhr_polling:class extends wr{constructor(e,t,n){super(e,t,n),this.shortName=Er,n.stream=!1,this.shortName=Er}static isAvailable(){return!(!g.Config.xhrSupported||!g.Config.allowComet)}toString(){return"XHRPollingTransport; uri="+this.baseUri+"; isConnected="+this.isConnected}createRequest(e,t,n,r,i){return Pr.createRequest(e,t,n,r,i,this.timeouts,this.logger)}}}},jr={connectivityCheckUrl:"https://internet-up.ably-realtime.com/is-the-internet-up.txt",wsConnectivityCheckUrl:"wss://ws-up.ably-realtime.com",defaultTransports:[un.XhrPolling,un.WebSocket]};function Cr(e,t,n){for(let r=0,i=n.length;r>>0&127|0);else if(i<2048)e.setUint8(t++,i>>>6&31|192),e.setUint8(t++,i>>>0&63|128);else if(i<65536)e.setUint8(t++,i>>>12&15|224),e.setUint8(t++,i>>>6&63|128),e.setUint8(t++,i>>>0&63|128);else{if(!(i<1114112))throw new Error("bad codepoint "+i);e.setUint8(t++,i>>>18&7|240),e.setUint8(t++,i>>>12&63|128),e.setUint8(t++,i>>>6&63|128),e.setUint8(t++,i>>>0&63|128)}}}function Ar(e,t,n){let r="";for(let i=t,o=t+n;i=0){if(e<128)return t.setUint8(n,e),1;if(e<256)return t.setUint8(n,204),t.setUint8(n+1,e),2;if(e<65536)return t.setUint8(n,205),t.setUint16(n+1,e),3;if(e<4294967296)return t.setUint8(n,206),t.setUint32(n+1,e),5;if(e<0x10000000000000000)return t.setUint8(n,207),function(e,t,n){n<0x10000000000000000?(e.setUint32(t,Math.floor(n*Qr)),e.setInt32(t+4,-1&n)):(e.setUint32(t,4294967295),e.setUint32(t+4,4294967295))}(t,n+1,e),9;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return t.setInt8(n,e),1;if(e>=-128)return t.setUint8(n,208),t.setInt8(n+1,e),2;if(e>=-32768)return t.setUint8(n,209),t.setInt16(n+1,e),3;if(e>=-2147483648)return t.setUint8(n,210),t.setInt32(n+1,e),5;if(e>=-0x8000000000000000)return t.setUint8(n,211),function(e,t,n){n<0x8000000000000000?(e.setInt32(t,Math.floor(n*Qr)),e.setInt32(t+4,-1&n)):(e.setUint32(t,2147483647),e.setUint32(t+4,2147483647))}(t,n+1,e),9;throw new Error("Number too small -0x"+(-e).toString(16).substr(1))}if("undefined"===i)return r?0:(t.setUint8(n,212),t.setUint8(n+1,0),t.setUint8(n+2,0),3);if(null===e)return r?0:(t.setUint8(n,192),1);if("boolean"===i)return t.setUint8(n,e?195:194),1;if("function"==typeof e.toJSON)return Mr(e.toJSON(),t,n,r);if("object"===i){let i,o,a=0;const s=Array.isArray(e);if(s?i=e.length:(o=Ir(e,r),i=o.length),i<16?(t.setUint8(n,i|(s?144:128)),a=1):i<65536?(t.setUint8(n,s?220:222),t.setUint16(n+1,i),a=3):i<4294967296&&(t.setUint8(n,s?221:223),t.setUint32(n+1,i),a=5),s)for(let o=0;o=0){if(e<128)return 1;if(e<256)return 2;if(e<65536)return 3;if(e<4294967296)return 5;if(e<0x10000000000000000)return 9;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return 1;if(e>=-128)return 2;if(e>=-32768)return 3;if(e>=-2147483648)return 5;if(e>=-0x8000000000000000)return 9;throw new Error("Number too small -0x"+e.toString(16).substr(1))}if("boolean"===n)return 1;if(null===e)return t?0:1;if(void 0===e)return t?0:3;if("function"==typeof e.toJSON)return Dr(e.toJSON(),t);if("object"===n){let n,r=0;if(Array.isArray(e)){n=e.length;for(let i=0;i{const t={};for(let n=0;n{const t=new ArrayBuffer(e);return new Uint8Array(t).set(new Uint8Array(this.view.buffer,this.offset,e),0),this.offset+=e,t},this.buf=this.bin,this.str=e=>{const t=Ar(this.view,this.offset,e);return this.offset+=e,t},this.array=e=>{const t=new Array(e);for(let n=0;n(this.offset+=e,{type:this.view.getInt8(this.offset),data:this.buf(e)}),this.parse=()=>{const e=this.view.getUint8(this.offset);let t,n;if(0==(128&e))return this.offset++,e;if(128==(240&e))return n=15&e,this.offset++,this.map(n);if(144==(240&e))return n=15&e,this.offset++,this.array(n);if(160==(224&e))return n=31&e,this.offset++,this.str(n);if(224==(224&e))return t=this.view.getInt8(this.offset),this.offset++,t;switch(e){case 192:return this.offset++,null;case 193:return void this.offset++;case 194:return this.offset++,!1;case 195:return this.offset++,!0;case 196:return n=this.view.getUint8(this.offset+1),this.offset+=2,this.bin(n);case 197:return n=this.view.getUint16(this.offset+1),this.offset+=3,this.bin(n);case 198:return n=this.view.getUint32(this.offset+1),this.offset+=5,this.bin(n);case 199:return n=this.view.getUint8(this.offset+1),this.offset+=2,this.ext(n);case 200:return n=this.view.getUint16(this.offset+1),this.offset+=3,this.ext(n);case 201:return n=this.view.getUint32(this.offset+1),this.offset+=5,this.ext(n);case 202:return t=this.view.getFloat32(this.offset+1),this.offset+=5,t;case 203:return t=this.view.getFloat64(this.offset+1),this.offset+=9,t;case 204:return t=this.view.getUint8(this.offset+1),this.offset+=2,t;case 205:return t=this.view.getUint16(this.offset+1),this.offset+=3,t;case 206:return t=this.view.getUint32(this.offset+1),this.offset+=5,t;case 207:return t=function(e,t){return t=t||0,e.getUint32(t)*$r+e.getUint32(t+4)}(this.view,this.offset+1),this.offset+=9,t;case 208:return t=this.view.getInt8(this.offset+1),this.offset+=2,t;case 209:return t=this.view.getInt16(this.offset+1),this.offset+=3,t;case 210:return t=this.view.getInt32(this.offset+1),this.offset+=5,t;case 211:return t=function(e,t){return t=t||0,e.getInt32(t)*$r+e.getUint32(t+4)}(this.view,this.offset+1),this.offset+=9,t;case 212:return n=1,this.offset++,this.ext(n);case 213:return n=2,this.offset++,this.ext(n);case 214:return n=4,this.offset++,this.ext(n);case 215:return n=8,this.offset++,this.ext(n);case 216:return n=16,this.offset++,this.ext(n);case 217:return n=this.view.getUint8(this.offset+1),this.offset+=2,this.str(n);case 218:return n=this.view.getUint16(this.offset+1),this.offset+=3,this.str(n);case 219:return n=this.view.getUint32(this.offset+1),this.offset+=5,this.str(n);case 220:return n=this.view.getUint16(this.offset+1),this.offset+=3,this.array(n);case 221:return n=this.view.getUint32(this.offset+1),this.offset+=5,this.array(n);case 222:return n=this.view.getUint16(this.offset+1),this.offset+=3,this.map(n);case 223:return n=this.view.getUint32(this.offset+1),this.offset+=5,this.map(n)}throw new Error("Unknown type 0x"+e.toString(16))},this.offset=t||0,this.view=e}}(t),r=n.parse();if(n.offset!==e.byteLength)throw new Error(e.byteLength-n.offset+" trailing bytes");return r},inspect:function(e){if(void 0===e)return"undefined";let t,n;if(e instanceof ArrayBuffer?(n="ArrayBuffer",t=new DataView(e)):e instanceof DataView&&(n="DataView",t=e),!t)return JSON.stringify(e);const r=[];for(let n=0;n20){r.push("...");break}let e=t.getUint8(n).toString(16);1===e.length&&(e="0"+e),r.push(e)}return"<"+n+" "+r.join(" ")+">"},utf8Write:Cr,utf8Read:Ar,utf8ByteCount:Rr},Lr={XHRRequest:Pr,FetchRequest:async function(e,t,n,r,i,o){const a=new Headers(r||{}),s=e?e.toUpperCase():R(o)?"GET":"POST",u=new AbortController;let c;const l=new Promise((e=>{c=setTimeout((()=>{u.abort(),e({error:new P("Request timed out",null,408)})}),t?t.options.timeouts.httpRequestTimeout:Ae.TIMEOUTS.httpRequestTimeout)})),f={method:s,headers:a,body:o,signal:u.signal};g.Config.isWebworker||(f.credentials=a.has("authorization")?"include":"same-origin");const h=(async()=>{try{const e=new URLSearchParams(i||{});e.set("rnd",te());const t=n+"?"+e,r=await he().fetch(t,f);if(clearTimeout(c),204==r.status)return{error:null,statusCode:r.status};const o=r.headers.get("Content-Type");let a;a=o&&o.indexOf("application/x-msgpack")>-1?await r.arrayBuffer():o&&o.indexOf("application/json")>-1?await r.json():await r.text();const s=!!o&&-1===o.indexOf("application/x-msgpack"),u=function(e){const t={};return e.forEach(((e,n)=>{t[n]=e})),t}(r.headers);if(r.ok)return{error:null,body:a,headers:u,unpacked:s,statusCode:r.status};{const e=function(e,t){if(function(e,t){return!!t.get("x-ably-errorcode")}(0,t))return e.error&&_.fromValues(e.error)}(a,r.headers)||new P("Error response received from server: "+r.status+" body was: "+g.Config.inspect(a),null,r.status);return{error:e,body:a,headers:u,unpacked:s,statusCode:r.status}}}catch(e){return clearTimeout(c),{error:e}}})();return Promise.race([l,h])}},qr=function(e,t){class n{constructor(e,t,n,r){this.algorithm=e,this.keyLength=t,this.mode=n,this.key=r}}class r{static getDefaultParams(e){var r;if(!e.key)throw new Error("Crypto.getDefaultParams: a key is required");r="string"==typeof e.key?t.toArrayBuffer(t.base64Decode(e.key.replace("_","/").replace("-","+"))):e.key instanceof ArrayBuffer?e.key:t.toArrayBuffer(e.key);var i=e.algorithm||"aes",o=8*r.byteLength,a=e.mode||"cbc",s=new n(i,o,a,r);if(e.keyLength&&e.keyLength!==s.keyLength)throw new Error("Crypto.getDefaultParams: a keyLength of "+e.keyLength+" was specified, but the key actually has length "+s.keyLength);return function(e){if("aes"===e.algorithm&&"cbc"===e.mode){if(128===e.keyLength||256===e.keyLength)return;throw new Error("Unsupported key length "+e.keyLength+" for aes-cbc encryption. Encryption key must be 128 or 256 bits (16 or 32 ASCII characters)")}}(s),s}static async generateRandomKey(t){try{return e.getRandomArrayBuffer((t||256)/8)}catch(e){throw new _("Failed to generate random key: "+e.message,400,5e4,e)}}static getCipher(e,t){var r,o=function(e){return e instanceof n}(e)?e:this.getDefaultParams(e);return{cipherParams:o,cipher:new i(o,null!=(r=e.iv)?r:null,t)}}}r.CipherParams=n;class i{constructor(e,n,r){if(this.logger=r,!crypto.subtle)throw isSecureContext?new Error("Crypto operations are not possible since the browser’s SubtleCrypto class is unavailable (reason unknown)."):new Error("Crypto operations are is not possible since the current environment is a non-secure context and hence the browser’s SubtleCrypto class is not available.");this.algorithm=e.algorithm+"-"+String(e.keyLength)+"-"+e.mode,this.webCryptoAlgorithm=e.algorithm+"-"+e.mode,this.key=t.toArrayBuffer(e.key),this.iv=n?t.toArrayBuffer(n):null}concat(e,n){const r=new ArrayBuffer(e.byteLength+n.byteLength),i=new DataView(r),o=new DataView(t.toArrayBuffer(e));for(let e=0;e{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Object.getOwnPropertyNames(t))Object.prototype.hasOwnProperty.call(e,i)||i===n||Object.defineProperty(e,i,{get:()=>t[i],enumerable:!(r=Object.getOwnPropertyDescriptor(t,i))||r.enumerable});return e})(r.exports,n)),r.exports},e.exports=n()}).call(this,n(239))},582:function(e,t,n){"use strict";n.d(t,"a",(function(){return P})),n.d(t,"b",(function(){return D})),n.d(t,"c",(function(){return M})),n.d(t,"d",(function(){return le})),n.d(t,"e",(function(){return Z}));var r=n(11),i=n(7);function o(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?e.setAttribute(r,i):null!=i&&(e[r]=i)}t++}for(;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;y(this,e),this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(e){return o(x(e))}:x,this.query=this.normalize(n)}return O(e,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Object(i.r)(this.buffer,this.bufferPos)}},{key:"next",value:function(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}},{key:"nextOverlapping",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=Object(i.x)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Object(i.s)(e);var r=this.normalize(t);if(r.length)for(var o=0,a=n;;o++){var s=r.charCodeAt(o),u=this.match(s,a,this.bufferPos+this.bufferStart);if(o==r.length-1){if(u)return this.value=u,this;break}a==n&&o3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.length;if(y(this,e),this.text=t,this.to=o,this.curLine="",this.done=!1,this.value=S,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new j(t,n,r,i,o);this.re=new RegExp(n,_+((null==r?void 0:r.ignoreCase)?"i":"")),this.test=null==r?void 0:r.test,this.iter=t.iter();var a=t.lineAt(i);this.curLineStart=a.from,this.matchPos=C(t,i),this.getLine(this.curLineStart)}return O(e,[{key:"getLine",value:function(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}},{key:"nextLine",value:function(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}},{key:"next",value:function(){for(var e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;var t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){var n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=C(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=r||i.to<=n){var o=new e(n,t.sliceString(n,r));return E.set(t,o),o}if(i.from==n&&i.to==r)return i;var a=i.text,s=i.from;return s>n&&(a=t.sliceString(n,s)+a,s=n),i.to=this.to?this.to:this.text.lineAt(e).to}},{key:"next",value:function(){for(;;){var e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){var n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=C(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=T.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}]),e}();function C(e,t){if(t>=e.length)return t;for(var n,r=e.lineAt(t);t=56320&&n<57344;)t++;return t}function A(e){var t=o("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){var n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(n){var o=e.state,a=o.doc.lineAt(o.selection.main.head),s=d(n,5),u=s[1],c=s[2],l=s[3],f=s[4],h=l?+l.slice(1):0,p=c?+c:a.number;if(c&&f){var m=p/100;u&&(m=m*("-"==u?-1:1)+a.number/o.doc.lines),p=Math.round(o.doc.lines*m)}else c&&u&&(p=p*("-"==u?-1:1)+a.number);var v=o.doc.line(Math.max(1,Math.min(o.doc.lines,p))),g=i.f.cursor(v.from+Math.max(0,Math.min(h,v.length)));e.dispatch({effects:[R.of(!1),r.c.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}}return{dom:o("form",{class:"cm-gotoLine",onkeydown:function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({effects:R.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:function(e){e.preventDefault(),n()}},o("label",e.state.phrase("Go to line"),": ",t)," ",o("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(P.prototype[Symbol.iterator]=j.prototype[Symbol.iterator]=function(){return this});var R=i.n.define(),$=i.o.define({create:function(){return!0},update:function(e,t){var n,r=p(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(R)&&(e=i.value)}}catch(e){r.e(e)}finally{r.f()}return e},provide:function(e){return r.w.from(e,(function(e){return e?A:null}))}}),Q=r.c.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}});var I=i.h.define({combine:function(e){return Object(i.t)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:function(e){return new fe(e)},scrollToMatch:function(e){return r.c.scrollIntoView(e)}})}});function M(e){return e?[I.of(e),ve]:ve}var D=function(){function e(t){y(this,e),this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,_),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}return O(e,[{key:"unquote",value:function(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"}))}},{key:"eq",value:function(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}},{key:"create",value:function(){return this.regexp?new B(this):new L(this)}},{key:"getCursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=e.doc?e:i.g.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?q(this,r,t,n):F(this,r,t,n)}}]),e}(),N=O((function e(t){y(this,e),this.spec=t}));function F(e,t,n,r){return new k(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:function(e){return e.toLowerCase()},e.wholeWord?(o=t.doc,a=t.charCategorizer(t.selection.main.head),function(e,t,n,r){return(r>e||r+n.length=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=F(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));!i.next().done;)r(i.value.from,i.value.to)}}]),t}(N);function q(e,t,n,r){return new P(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(o=t.charCategorizer(t.selection.main.head),function(e,t,n){return!n[0].length||(o(z(n.input,n.index))!=i.d.Word||o(U(n.input,n.index))!=i.d.Word)&&(o(U(n.input,n.index+n[0].length))!=i.d.Word||o(z(n.input,n.index+n[0].length))!=i.d.Word)}):void 0},n,r);var o}function z(e,t){return e.slice(Object(i.v)(e,t,!1),t)}function U(e,t){return e.slice(t,Object(i.v)(e,t))}var B=function(e){function t(){return y(this,t),u(this,t,arguments)}return f(t,e),O(t,[{key:"nextMatch",value:function(e,t,n){var r=q(this.spec,e,n,e.doc.length).next();return r.done&&(r=q(this.spec,e,0,t).next()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(e,t,n){for(var r=1;;r++){for(var i=Math.max(t,n-1e4*r),o=q(this.spec,e,i,n),a=null;!o.next().done;)a=o.value;if(a&&(i==t||a.from>i+10))return a;if(i==t)return null}}},{key:"prevMatch",value:function(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}},{key:"getReplacement",value:function(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(function(t,n){return"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=q(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));!i.next().done;)r(i.value.from,i.value.to)}}]),t}(N),Z=i.n.define(),V=i.n.define(),W=i.o.define({create:function(e){return new X(oe(e).create(),null)},update:function(e,t){var n,r=p(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(Z)?e=new X(i.value.create(),e.panel):i.is(V)&&(e=new X(e.query,i.value?ie:null))}}catch(e){r.e(e)}finally{r.f()}return e},provide:function(e){return r.w.from(e,(function(e){return e.panel}))}});var X=O((function e(t,n){y(this,e),this.query=t,this.panel=n})),Y=r.a.mark({class:"cm-searchMatch"}),G=r.a.mark({class:"cm-searchMatch cm-searchMatch-selected"}),H=r.e.fromClass(function(){function e(t){y(this,e),this.view=t,this.decorations=this.highlight(t.state.field(W))}return O(e,[{key:"update",value:function(e){var t=e.state.field(W);(t!=e.startState.field(W)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel||!t.spec.valid)return r.a.none;for(var n=this.view,o=new i.l,a=0,s=n.visibleRanges,u=s.length;as[a+1].from-500;)f=s[++a].to;t.highlight(n.state,l,f,(function(e,t){var r=n.state.selection.ranges.some((function(n){return n.from==e&&n.to==t}));o.add(e,t,r?G:Y)}))}return o.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function K(e){return function(t){var n=t.state.field(W,!1);return n&&n.query.spec.valid?e(t,n):ue(t)}}var J=K((function(e,t){var n=t.query,r=e.state.selection.main.to,o=n.nextMatch(e.state,r,r);if(!o)return!1;var a=i.f.single(o.from,o.to),s=e.state.facet(I);return e.dispatch({selection:a,effects:[de(e,o),s.scrollToMatch(a.main,e)],userEvent:"select.search"}),se(e),!0})),ee=K((function(e,t){var n=t.query,r=e.state,o=r.selection.main.from,a=n.prevMatch(r,o,o);if(!a)return!1;var s=i.f.single(a.from,a.to),u=e.state.facet(I);return e.dispatch({selection:s,effects:[de(e,a),u.scrollToMatch(s.main,e)],userEvent:"select.search"}),se(e),!0})),te=K((function(e,t){var n=t.query.matchAll(e.state,1e3);return!(!n||!n.length)&&(e.dispatch({selection:i.f.create(n.map((function(e){return i.f.range(e.from,e.to)}))),userEvent:"select.search.matches"}),!0)})),ne=K((function(e,t){var n=t.query,o=e.state,a=o.selection.main,s=a.from,u=a.to;if(o.readOnly)return!1;var c=n.nextMatch(o,s,s);if(!c)return!1;var l,f,h=[],p=[];if(c.from==s&&c.to==u&&(f=o.toText(n.getReplacement(c)),h.push({from:c.from,to:c.to,insert:f}),c=n.nextMatch(o,c.from,c.to),p.push(r.c.announce.of(o.phrase("replaced match on line $",o.doc.lineAt(s).number)+"."))),c){var d=0==h.length||h[0].from>=c.to?0:c.to-c.from-f.length;l=i.f.single(c.from-d,c.to-d),p.push(de(e,c)),p.push(o.facet(I).scrollToMatch(l.main,e))}return e.dispatch({changes:h,selection:l,effects:p,userEvent:"input.replace"}),!0})),re=K((function(e,t){var n=t.query;if(e.state.readOnly)return!1;var i=n.matchAll(e.state,1e9).map((function(e){return{from:e.from,to:e.to,insert:n.getReplacement(e)}}));if(!i.length)return!1;var o=e.state.phrase("replaced $ matches",i.length)+".";return e.dispatch({changes:i,effects:r.c.announce.of(o),userEvent:"input.replace.all"}),!0}));function ie(e){return e.state.facet(I).createPanel(e)}function oe(e,t){var n,r,i,o,a,s=e.selection.main,u=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!u)return t;var c=e.facet(I);return new D({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(i=null==t?void 0:t.literal)&&void 0!==i?i:c.literal,regexp:null!==(o=null==t?void 0:t.regexp)&&void 0!==o?o:c.regexp,wholeWord:null!==(a=null==t?void 0:t.wholeWord)&&void 0!==a?a:c.wholeWord})}function ae(e){var t=Object(r.k)(e,ie);return t&&t.dom.querySelector("[main-field]")}function se(e){var t=ae(e);t&&t==e.root.activeElement&&t.select()}var ue=function(e){var t=e.state.field(W,!1);if(t&&t.panel){var n=ae(e);if(n&&n!=e.root.activeElement){var r=oe(e.state,t.query.spec);r.valid&&e.dispatch({effects:Z.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[V.of(!0),t?Z.of(oe(e.state,t.query.spec)):i.n.appendConfig.of(ve)]});return!0},ce=function(e){var t=e.state.field(W,!1);if(!t||!t.panel)return!1;var n=Object(r.k)(e,ie);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:V.of(!1)}),!0},le=[{key:"Mod-f",run:ue,scope:"editor search-panel"},{key:"F3",run:J,shift:ee,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:J,shift:ee,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ce,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(e){var t=e.state,n=e.dispatch,r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;for(var o=r.main,a=o.from,s=o.to,u=[],c=0,l=new k(t.doc,t.sliceDoc(a,s));!l.next().done;){if(u.length>1e3)return!1;l.value.from==a&&(c=u.length),u.push(i.f.range(l.value.from,l.value.to))}return n(t.update({selection:i.f.create(u,c),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:function(e){var t=Object(r.k)(e,A);if(!t){var n=[R.of(!0)];null==e.state.field($,!1)&&n.push(i.n.appendConfig.of([$,Q])),e.dispatch({effects:n}),t=Object(r.k)(e,A)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:function(e){var t=e.state,n=e.dispatch,o=t.selection.ranges;if(o.some((function(e){return e.from===e.to})))return function(e){var t=e.state,n=e.dispatch,r=t.selection,o=i.f.create(r.ranges.map((function(e){return t.wordAt(e.head)||i.f.cursor(e.head)})),r.mainIndex);return!o.eq(r)&&(n(t.update({selection:o})),!0)}({state:t,dispatch:n});var a=t.sliceDoc(o[0].from,o[0].to);if(t.selection.ranges.some((function(e){return t.sliceDoc(e.from,e.to)!=a})))return!1;var s=function(e,t){for(var n,r=e.selection,i=r.main,o=r.ranges,a=e.wordAt(i.head),s=a&&a.from==i.from&&a.to==i.to,u=function(n,r){if(r.next(),!r.done){if(n&&o.some((function(e){return e.from==r.value.from})))return c=n,l=r,0;if(s){var i=e.wordAt(r.value.from);if(!i||i.from!=r.value.from||i.to!=r.value.to)return c=n,l=r,0}return{v:r.value}}if(n)return{v:null};r=new k(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),c=n=!0,l=r},c=!1,l=new k(e.doc,t,o[o.length-1].to);;)if(0!==(n=u(c,l))&&n)return n.v}(t,a);return!!s&&(n(t.update({selection:t.selection.addRange(i.f.range(s.from,s.to),!1),effects:r.c.scrollIntoView(s.to)})),!0)},preventDefault:!0}],fe=function(){function e(t){var n=this;y(this,e),this.view=t;var r=this.query=t.state.field(W).query.spec;function i(e,t,n){return o("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=o("input",{value:r.search,placeholder:he(t,"Find"),"aria-label":he(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=o("input",{value:r.replace,placeholder:he(t,"Replace"),"aria-label":he(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=o("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=o("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=o("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit}),this.dom=o("div",{onkeydown:function(e){return n.keydown(e)},class:"cm-search"},[this.searchField,i("next",(function(){return J(t)}),[he(t,"next")]),i("prev",(function(){return ee(t)}),[he(t,"previous")]),i("select",(function(){return te(t)}),[he(t,"all")]),o("label",null,[this.caseField,he(t,"match case")]),o("label",null,[this.reField,he(t,"regexp")]),o("label",null,[this.wordField,he(t,"by word")])].concat(s(t.state.readOnly?[]:[o("br"),this.replaceField,i("replace",(function(){return ne(t)}),[he(t,"replace")]),i("replaceAll",(function(){return re(t)}),[he(t,"replace all")])]),[o("button",{name:"close",onclick:function(){return ce(t)},"aria-label":he(t,"close"),type:"button"},["×"])]))}return O(e,[{key:"commit",value:function(){var e=new D({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Z.of(e)}))}},{key:"keydown",value:function(e){Object(r.u)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ee:J)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),ne(this.view))}},{key:"update",value:function(e){var t,n=p(e.transactions);try{for(n.s();!(t=n.n()).done;){var r,i=p(t.value.effects);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.is(Z)&&!o.value.eq(this.query)&&this.setQuery(o.value)}}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}}},{key:"setQuery",value:function(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}},{key:"mount",value:function(){this.searchField.select()}},{key:"pos",get:function(){return 80}},{key:"top",get:function(){return this.view.state.facet(I).top}}]),e}();function he(e,t){return e.state.phrase(t)}var pe=/[\s\.,:;?!]/;function de(e,t){var n=t.from,i=t.to,o=e.state.doc.lineAt(n),a=e.state.doc.lineAt(i).to,s=Math.max(o.from,n-30),u=Math.min(a,i+30),c=e.state.sliceDoc(s,u);if(s!=o.from)for(var l=0;l<30;l++)if(!pe.test(c[l+1])&&pe.test(c[l])){c=c.slice(l);break}if(u!=a)for(var f=c.length-1;f>c.length-30;f--)if(!pe.test(c[f-1])&&pe.test(c[f])){c=c.slice(0,f);break}return r.c.announce.of("".concat(e.state.phrase("current match"),". ").concat(c," ").concat(e.state.phrase("on line")," ").concat(o.number,"."))}var me=r.c.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ve=[W,i.j.low(H),me]},583:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return f}));var r,i,o=n(18),a=n(861),s=n(588),u=n(240);function c(e){var t;switch(e){case r.Query:t="Query";break;case r.Mutation:t="Mutation";break;case r.Subscription:t="Subscription"}return t}function l(e){i||(i=new a.b(s.a.parser||1e3));var t,n,u=i.get(e);if(u)return u;Object(o.c)(!!e&&!!e.kind,62,e);for(var c=[],l=[],f=[],h=[],p=0,d=e.definitions;p=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){s();var t=JSON.stringify(e);return o()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=i(e,2),r=t[0],o=t[1];return Promise.all([r,o||n.miss(r)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=o();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},r().setItem(n,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=o();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function s(e){var t=o(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,i).catch((function(){return s({caches:t}).get(e,r,i)}))},set:function(e,r){return n.set(e,r).catch((function(){return s({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return s({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return s({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},o=JSON.stringify(n);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);var a=r(),s=i&&i.miss||function(){return Promise.resolve()};return a.then((function(e){return s(e)})).then((function(){return a}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===m.WithinHeaders?r:{}},queryParameters:function(){return e===m.WithinQueryParameters?r:{}}}}function l(e){var t=0;return e((function n(){return t++,new Promise((function(r){setTimeout((function(){r(e(n))}),Math.min(100*t,1e3))}))}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(n){return f(e.then((function(e){return Promise.all([t(e,n),e])})).then((function(e){return e[1]})))}})}function h(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function p(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function d(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var g={Read:1,Write:2,Any:3},y=1,b=2,O=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y;return n(n({},e),{},{status:t,lastUpdate:Date.now()})}function x(e){return"string"==typeof e?{protocol:"https",url:e,accept:g.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||g.Any}}var k="DELETE",S="GET",_="POST",P="PUT";function E(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===y||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return e.status===O&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(o(n),o(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return x(e)})):t}}))}function T(e,t,r,i){var a=[],s=function(e,t){if(e.method!==S&&(void 0!==e.data||void 0!==t.data)){var r=Array.isArray(e.data)?e.data:n(n({},e.data),t.data);return JSON.stringify(r)}}(r,i),u=function(e,t){var r=n(n({},e.headers),t.headers),i={};return Object.keys(r).forEach((function(e){var t=r[e];i[e.toLowerCase()]=t})),i}(e,i),c=r.method,l=r.method!==S?{}:n(n({},r.data),i.data),f=n(n(n({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),i.queryParameters),h=0,p=function t(n,o){var l=n.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:$(a)};var p={data:s,headers:u,method:c,url:A(l,r.path,f),connectTimeout:o(h,e.timeouts.connect),responseTimeout:o(h,i.timeout)},d=function(e){var t={request:p,response:e,host:l,triesLeft:n.length};return a.push(t),t},m={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(r){var i=d(r);return r.isTimedOut&&h++,Promise.all([e.logger.info("Retryable failure",Q(i)),e.hostsCache.set(l,w(l,r.isTimedOut?O:b))]).then((function(){return t(n,o)}))},onFail:function(e){throw d(e),function(e,t){var n=e.content,r=e.status,i=n;try{i=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(i,r,t)}(e,$(a))}};return e.requester.send(p).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,m)}))};return E(e.hostsCache,t).then((function(e){return p(o(e.statelessHosts).reverse(),e.getTimeout)}))}function j(e){var t=e.hostsCache,n=e.logger,r=e.requester,o=e.requestsCache,a=e.responsesCache,s=e.timeouts,u=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:a,timeouts:s,userAgent:u,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return x(e)})),read:function(e,t){var n=v(t,f.timeouts.read),r=function(){return T(f,f.hosts.filter((function(e){return 0!=(e.accept&g.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var o={request:e,mappedRequestOptions:n,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(function(){return f.requestsCache.get(o,(function(){return f.requestsCache.set(o,r()).then((function(e){return Promise.all([f.requestsCache.delete(o),e])}),(function(e){return Promise.all([f.requestsCache.delete(o),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(o,e)}})},write:function(e,t){return T(f,f.hosts.filter((function(e){return 0!=(e.accept&g.Write)})),e,v(t,f.timeouts.write))}};return f}function C(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function A(e,t,n){var r=R(n),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(i+="?".concat(r)),i}function R(e){return Object.keys(e).map((function(t){return d("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function $(e){return e.map((function(e){return Q(e)}))}function Q(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return n(n({},e),{},{request:n(n({},e.request),{},{headers:n(n({},e.request.headers),t)})})}var I=function(e){return function(t,n){return e.transporter.write({method:_,path:"2/abtests",data:t},n)}},M=function(e){return function(t,n){return e.transporter.write({method:k,path:d("2/abtests/%s",t)},n)}},D=function(e){return function(t,n){return e.transporter.read({method:S,path:d("2/abtests/%s",t)},n)}},N=function(e){return function(t){return e.transporter.read({method:S,path:"2/abtests"},t)}},F=function(e){return function(t,n){return e.transporter.write({method:_,path:d("2/abtests/%s/stop",t)},n)}},L=function(e){return function(t){return e.transporter.read({method:S,path:"1/strategies/personalization"},t)}},q=function(e){return function(t,n){return e.transporter.write({method:_,path:"1/strategies/personalization",data:t},n)}};function z(e){return function t(n){return e.request(n).then((function(r){if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})}))}({})}var U=function(e){return function(t,i){var o=i||{},a=o.queryParameters,s=r(o,["queryParameters"]),u=n({acl:t},void 0!==a?{queryParameters:a}:{});return f(e.transporter.write({method:_,path:"1/keys",data:u},s),(function(t,n){return l((function(r){return ee(e)(t.key,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},B=function(e){return function(t,n,r){var i=v(r);return i.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:_,path:"1/clusters/mapping",data:{cluster:n}},i)}},Z=function(e){return function(t,n,r){return e.transporter.write({method:_,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r)}},V=function(e){return function(t,n){return f(e.transporter.write({method:_,path:d("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},n),(function(t,n){return _e(e)(t.taskID,n)}))}},W=function(e){return function(t,n,r){return f(e.transporter.write({method:_,path:d("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},r),(function(n,r){return se(e)(t,{methods:{waitTask:ft}}).waitTask(n.taskID,r)}))}},X=function(e){return function(t,r,i){return W(e)(t,r,n(n({},i),{},{scope:[pt.Rules]}))}},Y=function(e){return function(t,r,i){return W(e)(t,r,n(n({},i),{},{scope:[pt.Settings]}))}},G=function(e){return function(t,r,i){return W(e)(t,r,n(n({},i),{},{scope:[pt.Synonyms]}))}},H=function(e){return function(t,n){return t.method===S?e.transporter.read(t,n):e.transporter.write(t,n)}},K=function(e){return function(t,n){return f(e.transporter.write({method:k,path:d("1/keys/%s",t)},n),(function(n,r){return l((function(n){return ee(e)(t,r).then(n).catch((function(e){if(404!==e.status)throw e}))}))}))}},J=function(e){return function(t,n,r){var i=n.map((function(e){return{action:"deleteEntry",body:{objectID:e}}}));return f(e.transporter.write({method:_,path:d("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:i}},r),(function(t,n){return _e(e)(t.taskID,n)}))}},ee=function(e){return function(t,n){return e.transporter.read({method:S,path:d("1/keys/%s",t)},n)}},te=function(e){return function(t,n){return e.transporter.read({method:S,path:d("1/task/%s",t.toString())},n)}},ne=function(e){return function(t){return e.transporter.read({method:S,path:"/1/dictionaries/*/settings"},t)}},re=function(e){return function(t){return e.transporter.read({method:S,path:"1/logs"},t)}},ie=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping/top"},t)}},oe=function(e){return function(t,n){return e.transporter.read({method:S,path:d("1/clusters/mapping/%s",t)},n)}},ae=function(e){return function(t){var n=t||{},i=n.retrieveMappings,o=r(n,["retrieveMappings"]);return!0===i&&(o.getClusters=!0),e.transporter.read({method:S,path:"1/clusters/mapping/pending"},o)}},se=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p({transporter:e.transporter,appId:e.appId,indexName:t},n.methods)}},ue=function(e){return function(t){return e.transporter.read({method:S,path:"1/keys"},t)}},ce=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters"},t)}},le=function(e){return function(t){return e.transporter.read({method:S,path:"1/indexes"},t)}},fe=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping"},t)}},he=function(e){return function(t,n,r){return f(e.transporter.write({method:_,path:d("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},r),(function(n,r){return se(e)(t,{methods:{waitTask:ft}}).waitTask(n.taskID,r)}))}},pe=function(e){return function(t,n){return f(e.transporter.write({method:_,path:"1/indexes/*/batch",data:{requests:t}},n),(function(t,n){return Promise.all(Object.keys(t.taskID).map((function(r){return se(e)(r,{methods:{waitTask:ft}}).waitTask(t.taskID[r],n)})))}))}},de=function(e){return function(t,n){return e.transporter.read({method:_,path:"1/indexes/*/objects",data:{requests:t}},n)}},me=function(e){return function(t,r){var i=t.map((function(e){return n(n({},e),{},{params:R(e.params||{})})}));return e.transporter.read({method:_,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},r)}},ve=function(e){return function(t,i){return Promise.all(t.map((function(t){var o=t.params,a=o.facetName,s=o.facetQuery,u=r(o,["facetName","facetQuery"]);return se(e)(t.indexName,{methods:{searchForFacetValues:st}}).searchForFacetValues(a,s,n(n({},i),u))})))}},ge=function(e){return function(t,n){var r=v(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:k,path:"1/clusters/mapping"},r)}},ye=function(e){return function(t,n,r){var i=n.map((function(e){return{action:"addEntry",body:e}}));return f(e.transporter.write({method:_,path:d("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:i}},r),(function(t,n){return _e(e)(t.taskID,n)}))}},be=function(e){return function(t,n){return f(e.transporter.write({method:_,path:d("1/keys/%s/restore",t)},n),(function(n,r){return l((function(n){return ee(e)(t,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},Oe=function(e){return function(t,n,r){var i=n.map((function(e){return{action:"addEntry",body:e}}));return f(e.transporter.write({method:_,path:d("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:i}},r),(function(t,n){return _e(e)(t.taskID,n)}))}},we=function(e){return function(t,n,r){return e.transporter.read({method:_,path:d("/1/dictionaries/%s/search",t),data:{query:n},cacheable:!0},r)}},xe=function(e){return function(t,n){return e.transporter.read({method:_,path:"1/clusters/mapping/search",data:{query:t}},n)}},ke=function(e){return function(t,n){return f(e.transporter.write({method:P,path:"/1/dictionaries/*/settings",data:t},n),(function(t,n){return _e(e)(t.taskID,n)}))}},Se=function(e){return function(t,n){var i=Object.assign({},n),o=n||{},a=o.queryParameters,s=r(o,["queryParameters"]),u=a?{queryParameters:a}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:P,path:d("1/keys/%s",t),data:u},s),(function(n,r){return l((function(n){return ee(e)(t,r).then((function(e){return function(e){return Object.keys(i).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){if(Array.isArray(e[t])&&Array.isArray(i[t])){var n=e[t];return n.length===i[t].length&&n.every((function(e,n){return e===i[t][n]}))}return e[t]===i[t]}))}(e)?Promise.resolve():n()}))}))}))}},_e=function(e){return function(t,n){return l((function(r){return te(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},Pe=function(e){return function(t,n){return f(e.transporter.write({method:_,path:d("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(function(t,n){return ft(e)(t.taskID,n)}))}},Ee=function(e){return function(t){return z(n(n({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(n){return e.transporter.read({method:_,path:d("1/indexes/%s/browse",e.indexName),data:n},t)}}))}},Te=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return z(n(n({shouldStop:function(e){return e.hits.length0&&void 0!==arguments[0]?arguments[0]:0;i=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return r()}))}()}},Ue=function(e){return function(t,n){return e.transporter.read({method:S,path:d("1/indexes/%s/%s",e.indexName,t)},n)}},Be=function(){return function(e,t){for(var n=0,r=Object.entries(e.hits);nn.OPENED&&void 0===r&&(clearTimeout(o),r=i(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(o),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(o),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:(i=vt,{debug:function(e,t){return dt>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return mt>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:s({caches:[a({key:"".concat("4.20.0","-").concat(e)}),u()]}),userAgent:C("4.20.0").add({segment:"Browser"})},l=n(n({},o),r),f=function(){return function(e){return function(e){var t=e.region||"us",r=c(m.WithinHeaders,e.appId,e.apiKey),i=j(n(n({hosts:[{url:"personalization.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({appId:e.appId,transporter:i},e.methods)}(n(n(n({},o),e),{},{methods:{getPersonalizationStrategy:L,setPersonalizationStrategy:q}}))}};return function(e){var t=e.appId,r=c(void 0!==e.authMode?e.authMode:m.WithinHeaders,t,e.apiKey),i=j(n(n({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:g.Read},{url:"".concat(t,".algolia.net"),accept:g.Write}].concat(h([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({transporter:i,appId:t,addAlgoliaAgent:function(e,t){i.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((function(){}))}},e.methods)}(n(n({},l),{},{methods:{search:me,searchForFacetValues:ve,multipleBatch:pe,multipleGetObjects:de,multipleQueries:me,copyIndex:W,copySettings:Y,copySynonyms:G,copyRules:X,moveIndex:he,listIndices:le,getLogs:re,listClusters:ce,multipleSearchForFacetValues:ve,getApiKey:ee,addApiKey:U,listApiKeys:ue,updateApiKey:Se,deleteApiKey:K,restoreApiKey:be,assignUserID:B,assignUserIDs:Z,getUserID:oe,searchUserIDs:xe,listUserIDs:fe,getTopUserIDs:ie,removeUserID:ge,hasPendingMappings:ae,clearDictionaryEntries:V,deleteDictionaryEntries:J,getDictionarySettings:ne,getAppTask:te,replaceDictionaryEntries:ye,saveDictionaryEntries:Oe,searchDictionaryEntries:we,setDictionarySettings:ke,waitAppTask:_e,customRequest:H,initIndex:function(e){return function(t){return se(e)(t,{methods:{batch:Pe,delete:Ie,findAnswers:qe,getObject:Ue,getObjects:Ze,saveObject:et,saveObjects:tt,search:at,searchForFacetValues:st,waitTask:ft,setSettings:lt,getSettings:We,partialUpdateObject:Ye,partialUpdateObjects:Ge,deleteObject:Me,deleteObjects:De,deleteBy:Qe,clearObjects:Ae,browseObjects:Ee,getObjectPosition:Be,findObject:ze,exists:Le,saveSynonym:it,saveSynonyms:ot,getSynonym:Xe,searchSynonyms:ct,browseSynonyms:je,deleteSynonym:Fe,clearSynonyms:$e,replaceAllObjects:He,replaceAllSynonyms:Je,searchRules:ut,getRule:Ve,deleteRule:Ne,saveRule:nt,saveRules:rt,replaceAllRules:Ke,browseRules:Te,clearRules:Re}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",r=c(m.WithinHeaders,e.appId,e.apiKey),i=j(n(n({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({appId:e.appId,transporter:i},e.methods)}(n(n(n({},o),e),{},{methods:{addABTest:I,getABTest:D,getABTests:N,stopABTest:F,deleteABTest:M}}))}},initPersonalization:f,initRecommendation:function(){return function(e){return l.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),f()(e)}}}}))}return gt.version="4.20.0",gt}()},585:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(69),i=n(92),o=n(800),a=n(799),s=n(482);function u(e,t){const{fingerprint:n,span:u,breadcrumbs:c,sdkProcessingMetadata:l}=t;!function(e,t){const{extra:n,tags:i,user:o,contexts:a,level:s,transactionName:u}=t,c=Object(r.c)(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});const l=Object(r.c)(i);l&&Object.keys(l).length&&(e.tags={...l,...e.tags});const f=Object(r.c)(o);f&&Object.keys(f).length&&(e.user={...f,...e.user});const h=Object(r.c)(a);h&&Object.keys(h).length&&(e.contexts={...h,...e.contexts});s&&(e.level=s);u&&(e.transaction=u)}(e,t),u&&function(e,t){e.contexts={trace:Object(s.c)(t),...e.contexts};const n=Object(a.a)(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:Object(o.b)(t),...e.sdkProcessingMetadata};const r=Object(s.b)(n).description;r&&(e.tags={transaction:r,...e.tags})}}(e,u),function(e,t){e.fingerprint=e.fingerprint?Object(i.c)(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,c),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,l)}function c(e,t){const{extra:n,tags:r,user:i,contexts:o,level:a,sdkProcessingMetadata:s,breadcrumbs:u,fingerprint:c,eventProcessors:f,attachments:h,propagationContext:p,transactionName:d,span:m}=t;l(e,"extra",n),l(e,"tags",r),l(e,"user",i),l(e,"contexts",o),l(e,"sdkProcessingMetadata",s),a&&(e.level=a),d&&(e.transactionName=d),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),c.length&&(e.fingerprint=[...e.fingerprint,...c]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...p}}function l(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}},587:function(e,t,n){"use strict";var r=n(0),i=n.n(r);t.a=i.a.createContext(null)},588:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(10),i=n(18),o=Symbol.for("apollo.cacheSize"),a=Object(r.__assign)({},i.b[o])},60:function(e,t,n){"use strict";var r;function i(e){return!!e&&e<7}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(r||(r={}))},615:function(e,t,n){"use strict";(function(e){var r=n(441);t.a=Object(r.a)((function(){return globalThis}))||Object(r.a)((function(){return window}))||Object(r.a)((function(){return self}))||Object(r.a)((function(){return e}))||Object(r.a)((function(){return r.a.constructor("return this")()}))}).call(this,n(239))},616:function(e,t,n){"use strict";function r(){for(var e=[],t=0;t{const r=a[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const u=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return r.a?o.forEach((n=>{t[n]=(...t)=>{e&&s((()=>{i.a.console[n](`Sentry Logger [${n}]:`,...t)}))}})):o.forEach((e=>{t[e]=()=>{}})),t}()},69:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return v})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return f})),n.d(t,"g",(function(){return l})),n.d(t,"h",(function(){return h}));var r=n(902),i=n(213),o=n(57),a=n(65),s=n(242);function u(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"==typeof i&&l(i,r),e[t]=i}function c(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){i.a&&a.c.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function l(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,c(e,"__sentry_original__",t)}catch(e){}}function f(e){return e.__sentry_original__}function h(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}function p(e){if(Object(o.d)(e))return{message:e.message,name:e.name,stack:e.stack,...m(e)};if(Object(o.f)(e)){const t={type:e.type,target:d(e.target),currentTarget:d(e.currentTarget),...m(e)};return"undefined"!=typeof CustomEvent&&Object(o.g)(e,CustomEvent)&&(t.detail=e.detail),t}return e}function d(e){try{return Object(o.c)(e)?Object(r.c)(e):Object.prototype.toString.call(e)}catch(e){return""}}function m(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function v(e,t=40){const n=Object.keys(p(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Object(s.d)(n[0],t);for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:Object(s.d)(r,t)}return""}function g(e){return y(e,new Map)}function y(e,t){if(function(e){if(!Object(o.j)(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(e){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const n of Object.keys(e))void 0!==e[n]&&(r[n]=y(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach((e=>{r.push(y(e,t))})),r}return e}},7:function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function i(e,t,n){return t=u(t),function(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!e})()}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=s(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},a.apply(this,arguments)}function s(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nthis.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));return this.lineInner(e,!1,1,0)}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));return this.lineInner(e,!0,1,0)}},{key:"replace",value:function(e,t,n){var r=h(j(this,e,t),2);e=r[0],t=r[1];var i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),w.from(i,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return this.replace(this.length,this.length,e)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=j(this,e,t),r=h(n,2);e=r[0],t=r[1];var i=[];return this.decompose(e,t,i,0),w.from(i,t-e)}},{key:"eq",value:function(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;for(var t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new _(this),i=new _(e),o=t,a=t;;){if(r.next(o),i.next(o),o=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new _(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new P(this,e,t)}},{key:"iterLines",value:function(e,t){var n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);var r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new E(n)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var e=[];return this.flatten(e),e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new O(t):w.from(O.split(t,[])):e.empty}}]),e}(),O=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x(e);return m(this,t),(n=i(this,t)).text=e,n.length=r,n}return c(t,e),g(t,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new T(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(e,n,r,i){var o=e<=0&&n>=this.length?this:new t(S(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(1&i){var a=r.pop(),s=k(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new t(s,a.length+o.length));else{var u=s.length>>1;r.push(new t(s.slice(0,u)),new t(s.slice(u)))}}else r.push(o)}},{key:"replace",value:function(e,n,r){if(!(r instanceof t))return a(u(t.prototype),"replace",this).call(this,e,n,r);var i=h(j(this,e,n),2);e=i[0],n=i[1];var o=k(this.text,k(r.text,S(this.text,0,e)),n),s=this.length+r.length-(n-e);return o.length<=32?new t(o,s):w.from(t.split(o,[]),s)}},{key:"sliceString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r=j(this,e,t),i=h(r,2);e=i[0],t=i[1];for(var o="",a=0,s=0;a<=t&&se&&s&&(o+=n),ea&&(o+=u.slice(Math.max(0,e-a),t-a)),a=c+1}return o}},{key:"flatten",value:function(e){var t,n=r(this.text);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(e,n){var i,o=[],a=-1,s=r(e);try{for(s.s();!(i=s.n()).done;){var u=i.value;o.push(u),a+=u.length+1,32==o.length&&(n.push(new t(o,a)),o=[],a=-1)}}catch(e){s.e(e)}finally{s.f()}return a>-1&&n.push(new t(o,a)),n}}]),t}(b),w=function(e){function t(e,n){var o;m(this,t),(o=i(this,t)).children=e,o.length=n,o.lines=0;var a,s=r(e);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.lines+=u.lines}}catch(e){s.e(e)}finally{s.f()}return o}return c(t,e),g(t,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(e,t,n,r){for(var i=0,o=0;o<=t&&i=o){var u=r&((o<=e?1:0)|(s>=t?2:0));o>=e&&s<=t&&!u?n.push(a):a.decompose(e-o,t-o,n,u)}o=s+1}}},{key:"replace",value:function(e,n,r){var i=h(j(this,e,n),2);if(e=i[0],n=i[1],r.lines=s&&n<=l){var f=c.replace(e-s,n-s,r),p=this.lines-c.lines+f.lines;if(f.lines

>4&&f.lines>p>>6){var d=this.children.slice();return d[o]=f,new t(d,this.length-(n-e)+r.length)}return a(u(t.prototype),"replace",this).call(this,s,l,f)}s=l+1}return a(u(t.prototype),"replace",this).call(this,e,n,r)}},{key:"sliceString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r=j(this,e,t),i=h(r,2);e=i[0],t=i[1];for(var o="",a=0,s=0;ae&&a&&(o+=n),es&&(o+=u.sliceString(e-s,t-s,n)),s=c+1}return o}},{key:"flatten",value:function(e){var t,n=r(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(e){n.e(e)}finally{n.f()}}},{key:"scanIdentical",value:function(e,n){if(!(e instanceof t))return 0;for(var r=0,i=h(n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1],4),o=i[0],a=i[1],s=i[2],u=i[3];;o+=n,a+=n){if(o==s||a==u)return r;var c=this.children[o],l=e.children[a];if(c!=l)return r+c.scanIdentical(l,n);r+=c.length+1}}}],[{key:"from",value:function(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.reduce((function(e,t){return e+t.length+1}),-1),o=0,a=r(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;o+=s.lines}}catch(e){a.e(e)}finally{a.f()}if(o<32){var u,c=[],l=r(e);try{for(l.s();!(u=l.n()).done;){var f=u.value;f.flatten(c)}}catch(e){l.e(e)}finally{l.f()}return new O(c,i)}var h=Math.max(32,o>>5),p=h<<1,d=h>>1,m=[],v=0,g=-1,y=[];function b(e){var n;if(e.lines>p&&e instanceof t){var i,o=r(e.children);try{for(o.s();!(i=o.n()).done;){b(i.value)}}catch(e){o.e(e)}finally{o.f()}}else e.lines>d&&(v>d||!v)?(w(),m.push(e)):e instanceof O&&v&&(n=y[y.length-1])instanceof O&&e.lines+n.lines<=32?(v+=e.lines,g+=e.length+1,y[y.length-1]=new O(n.text.concat(e.text),n.length+1+e.length)):(v+e.lines>h&&w(),v+=e.lines,g+=e.length+1,y.push(e))}function w(){0!=v&&(m.push(1==y.length?y[0]:t.from(y,g)),g=-1,v=y.length=0)}var x,k=r(e);try{for(k.s();!(x=k.n()).done;){var S=x.value;b(S)}}catch(e){k.e(e)}finally{k.f()}return w(),1==m.length?m[0]:new t(m,i)}}]),t}(b);function x(e){var t,n=-1,i=r(e);try{for(i.s();!(t=i.n()).done;){n+=t.value.length+1}}catch(e){i.e(e)}finally{i.f()}return n}function k(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(u>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;m(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof O?t.text.length:t.children.length)<<1]}return g(e,[{key:"nextInner",value:function(e,t){for(this.done=this.lineBreak=!1;;){var n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof O?r.text.length:r.children.length;if(o==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof O){var s=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,s.length>Math.max(0,e))return this.value=0==e?s:t>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{var u=r.children[o+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof O?u.text.length:u.children.length)<<1))}}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}]),e}(),P=function(){function e(t,n,r){m(this,e),this.value="",this.done=!1,this.cursor=new _(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return g(e,[{key:"nextInner",value:function(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);var n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;var r=this.cursor.next(e).value;return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&""!=this.value}}]),e}(),E=function(){function e(t){m(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return g(e,[{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.inner.next(e),n=t.done,r=t.lineBreak,i=t.value;return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),e}();"undefined"!=typeof Symbol&&(b.prototype[Symbol.iterator]=function(){return this.iter()},_.prototype[Symbol.iterator]=P.prototype[Symbol.iterator]=E.prototype[Symbol.iterator]=function(){return this});var T=function(){function e(t,n,r,i){m(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return g(e,[{key:"length",get:function(){return this.to-this.from}}]),e}();function j(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}for(var C="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((function(e){return e?parseInt(e,36):1})),A=1;Ae)return C[t-1]<=e;return!1}function $(e){return e>=127462&&e<=127487}function Q(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(n?I:M)(e,t,r)}function I(e,t,n){if(t==e.length)return t;t&&D(e.charCodeAt(t))&&N(e.charCodeAt(t-1))&&t--;var r=F(e,t);for(t+=q(r);t=0&&$(F(e,a));)o++,a-=2;if(o%2==0)break;t+=2}}return t}function M(e,t,n){for(;t>0;){var r=I(e,t-2,n);if(r=56320&&e<57344}function N(e){return e>=55296&&e<56320}function F(e,t){var n=e.charCodeAt(t);if(!N(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return D(r)?r-56320+(n-55296<<10)+65536:n}function L(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function q(e){return e<65536?1:2}var z=/\r\n?|\n/,U=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(U||(U={})),B=function(){function e(t){m(this,e),this.sections=t}return g(e,[{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];X(this,e,t)}},{key:"invertedDesc",get:function(){for(var t=[],n=0;n1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:Y(this,e,t)}},{key:"mapPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U.Simple,r=0,i=0,o=0;oe)return i+(e-r);i+=a}else{if(n!=U.Simple&&u>=e&&(n==U.TrackDel&&re||n==U.TrackBefore&&re))return null;if(u>e||u==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=u}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n=0&&r<=t&&a>=e)return!(rt)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"toJSON",value:function(){return this.sections}}],[{key:"fromJSON",value:function(t){if(!Array.isArray(t)||t.length%2||t.some((function(e){return"number"!=typeof e})))throw new RangeError("Invalid JSON representation of ChangeDesc");return new e(t)}},{key:"create",value:function(t){return new e(t)}}]),e}(),Z=function(e){function t(e,n){var r;return m(this,t),(r=i(this,t,[e])).inserted=n,r}return c(t,e),g(t,[{key:"apply",value:function(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return X(this,(function(t,n,r,i,o){return e=e.replace(r,r+(n-t),o)}),!1),e}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Y(this,e,t,!0)}},{key:"invert",value:function(e){for(var n=this.sections.slice(),r=[],i=0,o=0;i=0){n[i]=s,n[i+1]=a;for(var u=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:Y(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];X(this,e,t)}},{key:"desc",get:function(){return B.create(this.sections)}},{key:"filter",value:function(e){var n=[],r=[],i=[],o=new H(this);e:for(var a=0,s=0;;){for(var u=a==e.length?1e9:e[a++];s0&&W(r,n,o.text),o.forward(c),s+=c}for(var f=e[a++];s>1].toJSON()))}return e}}],[{key:"of",value:function(e,n,i){var o=[],a=[],s=0,u=null;function c(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||o.length){sm||p<0||m>n)throw new RangeError("Invalid change range ".concat(p," to ").concat(m," (in doc of length ").concat(n,")"));var g=v?"string"==typeof v?b.of(v.split(i||z)):v:b.empty,y=g.length;if(p==m&&0==y)return;ps&&V(o,p-s,-1),V(o,m-p,y),W(a,o,g),s=m}}(e),c(!u),u}},{key:"empty",value:function(e){return new t(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");for(var n=[],r=[],i=0;i3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function W(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)s=e.sections[a++],u=e.sections[a++];t(i,c,o,l,f),i=c,o=l}}}function Y(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new H(e),s=new H(t),u=-1;;)if(-1==a.ins&&-1==s.ins){var c=Math.min(a.len,s.len);V(i,c,-1),a.forward(c),s.forward(c)}else if(s.ins>=0&&(a.ins<0||u==a.i||0==a.off&&(s.len=0&&u=0)){if(a.done&&s.done)return o?Z.createSet(i,o):B.create(i);throw new Error("Mismatched change set lengths")}for(var h=0,p=a.len;p;)if(-1==s.ins){var d=Math.min(p,s.len);h+=d,p-=d,s.forward(d)}else{if(!(0==s.ins&&s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new H(e),a=new H(t),s=!1;;){if(o.done&&a.done)return i?Z.createSet(r,i):B.create(r);if(0==o.ins)V(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var u=Math.min(o.len2,a.len),c=r.length;if(-1==o.ins){var l=-1==a.ins?-1:a.off?0:a.ins;V(r,u,l,s),i&&l&&W(i,r,a.text)}else-1==a.ins?(V(r,o.off?0:o.len,u,s),i&&W(i,r,o.textBit(u))):(V(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&W(i,r,a.text));s=(o.ins>u||a.ins>=0&&a.len>u)&&(s||r.length>c),o.forward2(u),a.forward(u)}else V(r,0,a.ins,s),i&&W(i,r,a.text),a.next()}}var H=function(){function e(t){m(this,e),this.set=t,this.i=0,this.next()}return g(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return t>=e.length?b.empty:e[t]}},{key:"textBit",value:function(e){var t=this.set.inserted,n=this.i-2>>1;return n>=t.length&&!e?b.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}]),e}(),K=function(){function e(t,n,r){m(this,e),this.from=t,this.to=n,this.flags=r}return g(e,[{key:"anchor",get:function(){return 32&this.flags?this.to:this.from}},{key:"head",get:function(){return 32&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 8&this.flags?-1:16&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=7&this.flags;return 7==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>6;return 16777215==e?void 0:e}},{key:"map",value:function(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return this.empty?n=r=t.mapPos(this.from,i):(n=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new e(n,r,this.flags)}},{key:"extend",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e<=this.anchor&&t>=this.anchor)return J.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return J.range(this.anchor,n)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return J.range(e.anchor,e.head)}},{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}(),J=function(){function e(t,n){m(this,e),this.ranges=t,this.mainIndex=n}return g(e,[{key:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t,n)})),this.mainIndex)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(var n=0;n1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),main:this.mainIndex}}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return K.fromJSON(e)})),t.main)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return K.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:16777215)<<6)}},{key:"range",value:function(e,t,n,r){var i=(null!=n?n:16777215)<<6|(null==r?7:Math.min(6,r));return te?8:0)|i)}},{key:"normalized",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t[n];t.sort((function(e,t){return e.from-t.from})),n=t.indexOf(r);for(var i=1;io.head?e.range(u,s):e.range(s,u))}}return new e(t,n)}}]),e}();function ee(e,t){var n,i=r(e.ranges);try{for(i.s();!(n=i.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(e){i.e(e)}finally{i.f()}}var te=0,ne=function(){function e(t,n,r,i,o){m(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=te++,this.default=t([]),this.extensions="function"==typeof o?o(this):o}return g(e,[{key:"reader",get:function(){return this}},{key:"of",value:function(e){return new ie([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ie(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ie(e,this,2,t)}},{key:"from",value:function(e,t){return t||(t=function(e){return e}),this.compute([e],(function(n){return t(n.field(e))}))}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:re),!!t.static,t.enables)}}]),e}();function re(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var ie=function(){function e(t,n,r,i){m(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=te++}return g(e,[{key:"dynamicSlot",value:function(e){var t,n,i=this,o=this.value,a=this.facet.compareInput,s=this.id,u=e[s]>>1,c=2==this.type,l=!1,f=!1,h=[],p=r(this.dependencies);try{for(p.s();!(n=p.n()).done;){var d=n.value;"doc"==d?l=!0:"selection"==d?f=!0:0==(1&(null!==(t=e[d.id])&&void 0!==t?t:1))&&h.push(e[d.id])}}catch(e){p.e(e)}finally{p.f()}return{create:function(e){return e.values[u]=o(e),1},update:function(e,t){if(l&&t.docChanged||f&&(t.docChanged||t.selection)||ae(e,h)){var n=o(e);if(c?!oe(n,e.values[u],a):!a(n,e.values[u]))return e.values[u]=n,1}return 0},reconfigure:function(e,t){var n,r=t.config.address[s];if(null!=r){var l=Oe(t,r);if(i.dependencies.every((function(n){return n instanceof ne?t.facet(n)===e.facet(n):!(n instanceof ue)||t.field(n,!1)==e.field(n,!1)}))||(c?oe(n=o(e),l,a):a(n=o(e),l)))return e.values[u]=l,0}else n=o(e);return e.values[u]=n,1}}}}]),e}();function oe(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return{create:function(e){return e.values[n]=t.create(e),1},update:function(e,r){var i=e.values[n],o=t.updateF(i,r);return t.compareF(i,o)?0:(e.values[n]=o,1)},reconfigure:function(e,r){return null!=r.config.address[t.id]?(e.values[n]=r.field(t),0):(e.values[n]=t.create(e),1)}}}},{key:"init",value:function(e){return[this,se.of({field:this,create:e})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(t){var n=new e(te++,t.create,t.update,t.compare||function(e,t){return e===t},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),ce=4,le=3,fe=2,he=1;function pe(e){return function(t){return new me(t,e)}}var de={highest:pe(0),high:pe(he),default:pe(fe),low:pe(le),lowest:pe(ce)},me=g((function e(t,n){m(this,e),this.inner=t,this.prec=n})),ve=function(){function e(){m(this,e)}return g(e,[{key:"of",value:function(e){return new ge(this,e)}},{key:"reconfigure",value:function(t){return e.reconfigure.of({compartment:this,extension:t})}},{key:"get",value:function(e){return e.config.compartments.get(this)}}]),e}(),ge=g((function e(t,n){m(this,e),this.compartment=t,this.inner=n})),ye=function(){function e(t,n,r,i,o,a){for(m(this,e),this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t,n,i){var o,a=[],s=Object.create(null),u=new Map,c=r(function(e,t,n){var i=[[],[],[],[],[]],o=new Map;function a(e,s){var u=o.get(e);if(null!=u){if(u<=s)return;var c=i[u].indexOf(e);c>-1&&i[u].splice(c,1),e instanceof ge&&n.delete(e.compartment)}if(o.set(e,s),Array.isArray(e)){var l,f=r(e);try{for(f.s();!(l=f.n()).done;){a(l.value,s)}}catch(e){f.e(e)}finally{f.f()}}else if(e instanceof ge){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");var h=t.get(e.compartment)||e.inner;n.set(e.compartment,h),a(h,s)}else if(e instanceof me)a(e.inner,e.prec);else if(e instanceof ue)i[s].push(e),e.provides&&a(e.provides,s);else if(e instanceof ie)i[s].push(e),e.facet.extensions&&a(e.facet.extensions,fe);else{var p=e.extension;if(!p)throw new Error("Unrecognized extension value in extension set (".concat(e,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));a(p,s)}}return a(e,fe),i.reduce((function(e,t){return e.concat(t)}))}(t,n,u));try{for(c.s();!(o=c.n()).done;){var l=o.value;l instanceof ue?a.push(l):(s[l.facet.id]||(s[l.facet.id]=[])).push(l)}}catch(e){c.e(e)}finally{c.f()}for(var f=Object.create(null),h=[],p=[],d=function(){var e=v[m];f[e.id]=p.length<<1,p.push((function(t){return e.slot(t)}))},m=0,v=a;m>1;function u(e){for(var n=[],a=0;a>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Oe(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var we=ne.define(),xe=ne.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),ke=ne.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),Se=ne.define(),_e=ne.define(),Pe=ne.define(),Ee=ne.define({combine:function(e){return!!e.length&&e[0]}}),Te=function(){function e(t,n){m(this,e),this.type=t,this.value=n}return g(e,null,[{key:"define",value:function(){return new je}}]),e}(),je=function(){function e(){m(this,e)}return g(e,[{key:"of",value:function(e){return new Te(this,e)}}]),e}(),Ce=function(){function e(t){m(this,e),this.map=t}return g(e,[{key:"of",value:function(e){return new Ae(this,e)}}]),e}(),Ae=function(){function e(t,n){m(this,e),this.type=t,this.value=n}return g(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return void 0===n?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(e){return this.type==e}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ce(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,i=[],o=r(e);try{for(o.s();!(n=o.n()).done;){var a=n.value.map(t);a&&i.push(a)}}catch(e){o.e(e)}finally{o.f()}return i}}]),e}();Ae.reconfigure=Ae.define(),Ae.appendConfig=Ae.define();var Re=function(){function e(t,n,r,i,o,a){m(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&ee(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return g(e,[{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"annotation",value:function(e){var t,n=r(this.annotations);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.type==e)return i.value}}catch(e){n.e(e)}finally{n.f()}}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}},{key:"isUserEvent",value:function(t){var n=this.annotation(e.userEvent);return!(!n||!(n==t||n.length>t.length&&n.slice(0,t.length)==t&&"."==n[t.length]))}}],[{key:"create",value:function(t,n,r,i,o,a){return new e(t,n,r,i,o,a)}}]),e}();function $e(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=e[r]))o=e[r++],a=e[r++];else{if(!(i=0;i--){var o=n[i](e);o&&Object.keys(o).length&&(r=Qe(r,Ie(t,o,e.changes.newLength),!0))}return r==e?e:Re.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){var t,n=e.startState,i=!0,o=r(n.facet(Se));try{for(o.s();!(t=o.n()).done;){var a=(0,t.value)(e);if(!1===a){i=!1;break}Array.isArray(a)&&(i=!0===i?a:$e(i,a))}}catch(e){o.e(e)}finally{o.f()}if(!0!==i){var s,u;if(!1===i)u=e.changes.invertedDesc,s=Z.empty(n.doc.length);else{var c=e.changes.filter(i);s=c.changes,u=c.filtered.mapDesc(c.changes).invertedDesc}e=Re.create(n,s,e.selection&&e.selection.map(u),Ae.mapEffects(e.effects,u),e.annotations,e.scrollIntoView)}for(var l=n.facet(_e),f=l.length-1;f>=0;f--){var h=l[f](e);e=h instanceof Re?h:Array.isArray(h)&&1==h.length&&h[0]instanceof Re?h[0]:Me(n,Ne(h),!1)}return e}(s):s)}Re.time=Te.define(),Re.userEvent=Te.define(),Re.addToHistory=Te.define(),Re.remote=Te.define();var De=[];function Ne(e){return null==e?De:Array.isArray(e)?e:[e]}var Fe,Le=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Le||(Le={})),qe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{Fe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}function ze(e){return function(t){if(!/\S/.test(t))return Le.Space;if(function(e){if(Fe)return Fe.test(e);for(var t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||qe.test(n)))return!0}return!1}(t))return Le.Word;for(var n=0;n-1)return Le.Word;return Le.Other}}var Ue=function(){function e(t,n,r,i,o,a){m(this,e),this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(var s=0;s1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return be(this,n),Oe(this,n);if(t)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return t instanceof Z?t:Z.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return b.of(t.split(this.facet(e.lineSeparator)||z))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:(be(this,t),Oe(this,t))}},{key:"toJSON",value:function(e){var t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(var n in e){var r=e[n];r instanceof ue&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}},{key:"tabSize",get:function(){return this.facet(e.tabSize)}},{key:"lineBreak",get:function(){return this.facet(e.lineSeparator)||"\n"}},{key:"readOnly",get:function(){return this.facet(Ee)}},{key:"phrase",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;oi.length?e:i[n-1]}))),t}},{key:"languageDataAt",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=[],a=r(this.facet(we));try{for(a.s();!(n=a.n()).done;){var s,u=n.value,c=r(u(this,t,i));try{for(c.s();!(s=c.n()).done;){var l=s.value;Object.prototype.hasOwnProperty.call(l,e)&&o.push(l[e])}}catch(e){c.e(e)}finally{c.f()}}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"charCategorizer",value:function(e){return ze(this.languageDataAt("wordChars",e).join(""))}},{key:"wordAt",value:function(e){for(var t=this.doc.lineAt(e),n=t.text,r=t.from,i=t.length,o=this.charCategorizer(e),a=e-r,s=e-r;a>0;){var u=Q(n,a,!1);if(o(n.slice(u,a))!=Le.Word)break;a=u}for(;s1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(){if(Object.prototype.hasOwnProperty.call(t,a)){var e=r[a],n=t[a];i.push(e.init((function(t){return e.spec.fromJSON(n,t)})))}};for(var a in r)o()}return e.create({doc:t.doc,selection:J.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=ye.resolve(t.extensions||[],new Map),r=t.doc instanceof b?t.doc:b.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||z)),i=t.selection?t.selection instanceof J?t.selection:J.single(t.selection.anchor,t.selection.head):J.single(0);return ee(i,r.length),n.staticFacet(xe)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map((function(){return null})),(function(e,t){return t.create(e)}),null)}}]),e}();function Be(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={},a=r(e);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,u=0,c=Object.keys(s);u1&&void 0!==arguments[1]?arguments[1]:e;return Ve.create(e,t,this)}}]),e}();Ze.prototype.startSide=Ze.prototype.endSide=0,Ze.prototype.point=!1,Ze.prototype.mapMode=U.TrackDel;var Ve=function(){function e(t,n,r){m(this,e),this.from=t,this.to=n,this.value=r}return g(e,null,[{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}();function We(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var Xe=function(){function e(t,n,r,i){m(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=i}return g(e,[{key:"length",get:function(){return this.to[this.to.length-1]}},{key:"findIndex",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,u=i[s]-e||(n?this.value[s].endSide:this.value[s].startSide)-t;if(s==o)return u>=0?o:a;u>=0?a=s:o=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i(p=n.mapPos(f,c.endSide))||h==p&&c.startSide>0&&c.endSide<=0)continue;(p-h||c.endSide-c.startSide)<0||(a<0&&(a=h),c.point&&(s=Math.max(s,p-h)),r.push(c),i.push(h-a),o.push(p-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}}]),e}(),Ye=function(){function e(t,n,r,i){m(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return g(e,[{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this.isEmpty)return 0;var e,t=this.nextLayer.size,n=r(this.chunk);try{for(n.s();!(e=n.n()).done;){t+=e.value.value.length}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,o=void 0!==i&&i,a=t.filterFrom,s=void 0===a?0:a,u=t.filterTo,c=void 0===u?this.length:u,l=t.filter;if(0==r.length&&!l)return this;if(o&&(r=r.slice().sort(We)),this.isEmpty)return r.length?e.of(r):this;for(var f=new Je(this,null,-1).goto(0),h=0,p=[],d=new He;f.value||h=0){var m=r[h++];d.addInner(m.from,m.to,m.value)||p.push(m)}else 1==f.rangeIndex&&f.chunkIndexthis.chunkEnd(f.chunkIndex)||cf.to||c=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return et.from([this]).goto(e)}},{key:"isEmpty",get:function(){return this.nextLayer==this}}],[{key:"create",value:function(t,n,r,i){return new e(t,n,r,i)}},{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return et.from(e).goto(t)}},{key:"compare",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=e.filter((function(e){return e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i})),a=t.filter((function(e){return e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i})),s=Ke(o,a,n),u=new nt(o,s,i),c=new nt(a,s,i);n.iterGaps((function(e,t,n){return rt(u,e,c,t,n,r)})),n.empty&&0==n.length&&rt(u,0,c,0,0,r)}},{key:"eq",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;null==r&&(r=999999999);var i=e.filter((function(e){return!e.isEmpty&&t.indexOf(e)<0})),o=t.filter((function(t){return!t.isEmpty&&e.indexOf(t)<0}));if(i.length!=o.length)return!1;if(!i.length)return!0;for(var a=Ke(i,o),s=new nt(i,a,0).goto(n),u=new nt(o,a,0).goto(n);;){if(s.to!=u.to||!it(s.active,u.active)||s.point&&(!u.point||!s.point.eq(u.point)))return!1;if(s.to>r)return!0;s.next(),u.next()}}},{key:"spans",value:function(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new nt(e,null,i).goto(t),a=t,s=o.openStart;;){var u=Math.min(o.to,n);if(o.point){var c=o.activeForPoint(o.to),l=o.pointFroma&&(r.span(a,u,o.active,s),s=o.openEnd(u));if(o.to>n)return s+(o.point&&o.to>n?1:0);a=o.to,o.next()}}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new He,o=r(e instanceof Ve?[e]:n?Ge(e):e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i.add(a.from,a.to,a.value)}}catch(e){o.e(e)}finally{o.f()}return i.finish()}},{key:"join",value:function(t){if(!t.length)return e.empty;for(var n=t[t.length-1],r=t.length-2;r>=0;r--)for(var i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}]),e}();function Ge(e){if(e.length>1)for(var t=e[0],n=1;n0)return e.slice().sort(We);t=r}return e}Ye.empty=new Ye([],[],null,-1),Ye.empty.nextLayer=Ye.empty;var He=function(){function e(){m(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return g(e,[{key:"finishChunk",value:function(e){this.chunks.push(new Xe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(e,t,n){var r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}},{key:"addChunk",value:function(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);var n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}},{key:"finish",value:function(){return this.finishInner(Ye.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=Ye.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();function Ke(e,t,n){var i,o=new Map,a=r(e);try{for(a.s();!(i=a.n()).done;)for(var s=i.value,u=0;u3&&void 0!==arguments[3]?arguments[3]:0;m(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}return g(e,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}},{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"setRangeIndex",value:function(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex1&&void 0!==arguments[1]?arguments[1]:-1e9,i=r(this.heap);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.goto(e,n)}}catch(e){i.e(e)}finally{i.f()}for(var a=this.heap.length>>1;a>=0;a--)tt(this.heap,a);return this.next(),this}},{key:"forward",value:function(e,t){var n,i=r(this.heap);try{for(i.s();!(n=i.n()).done;){n.value.forward(e,t)}}catch(e){i.e(e)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)tt(this.heap,o);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),tt(this.heap,0)}}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new Je(a,n,r,o));return 1==i.length?i[0]:new e(i)}}]),e}();function tt(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var nt=function(){function e(t,n,r){m(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=et.from(t,n,r)}return g(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){ot(this.active,e),ot(this.activeTo,e),ot(this.activeRank,e),this.minActive=st(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;t0;)t++;at(this.active,t,r),at(this.activeTo,t,i),at(this.activeRank,t,o),e&&at(e,t,this.cursor.from),this.minActive=st(this.active,this.activeTo)}},{key:"next",value:function(){var e=this.to,t=this.point;this.point=null;for(var n=this.openStart<0?[]:null;;){var r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&ot(n,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[o]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}},{key:"openEnd",value:function(e){for(var t=0,n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}]),e}();function rt(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,u=r-t;;){var c=e.to+u-n.to||e.endSide-n.endSide,l=c<0?e.to+u:n.to,f=Math.min(l,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&it(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(s,f,e.point,n.point):f>s&&!it(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),l>a)break;s=l,c<=0&&e.next(),c>=0&&n.next()}}function it(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function st(e,t){for(var n=-1,r=1e9,i=0;i2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0;i=t)return i;if(i==e.length)break;o+=9==e.charCodeAt(i)?n-o%n:1,i=Q(e,i)}return!0===r?-1:e.length}},75:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(957)},76:function(e,t,n){"use strict";function r(e,t){return e===t}function i(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:r,n=null,o=null;return function(){return i(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:u;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map((function(t){return e[t]})),(function(){for(var e=arguments.length,t=Array(e),r=0;r(this.popScope(),e)),(e=>{throw this.popScope(),e})):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:Object(i.f)(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Object(i.f)(),o=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Object(i.f)();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=d}=r.getOptions&&r.getOptions()||{};if(s<=0)return;const u={timestamp:Object(o.a)(),...e},c=i?Object(a.b)((()=>i(u,t))):u;null!==c&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),n.addBreadcrumb(c,s))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=g(this);try{e(this)}finally{g(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return c.a&&a.c.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(c.a&&!n){this.getClient()?a.c.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):a.c.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&Object(f.a)(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=u.a}=n&&n.getOptions()||{},{userAgent:o}=s.a.navigator||{},a=Object(f.b)({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),c=t.getSession&&t.getSession();return c&&"ok"===c.status&&Object(f.c)(c,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){const n=v().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);c.a&&a.c.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function v(){return s.a.__SENTRY__=s.a.__SENTRY__||{extensions:{},hub:void 0},s.a}function g(e){const t=v(),n=k(t);return S(t,e),n}function y(){const e=v();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return O(e)}function b(){return y().getIsolationScope()}function O(e=v()){return x(e)&&!k(e).isOlderThan(p)||S(e,new m),k(e)}function w(e,t={}){const n=v();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(e,t):e()}function x(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function k(e){return Object(s.c)("hub",(()=>new m),e)}function S(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}},770:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(18),i=n(54),o=n(842);function a(e){var t=i.useContext(Object(o.a)()),n=e||t.client;return Object(r.c)(!!n,50),n}},771:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r,i=n(984),o=n(861),a=n(588),s=n(240),u=Object.assign((function(e){var t=r.get(e);return t||(t=Object(i.a)(e),r.set(e,t)),t}),{reset:function(){r=new o.b(a.a.print||2e3)}});u.reset(),!1!==globalThis.__DEV__&&Object(s.d)("print",(function(){return r?r.size:0}))},772:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(18),i=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var i=Object(r.e)(40,t,e.message);throw i.parseError=e,i}return n}},774:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="7.99.0"},78:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return T})),n.d(t,"b",(function(){return R})),n.d(t,"c",(function(){return k})),n.d(t,"d",(function(){return N})),n.d(t,"e",(function(){return F})),n.d(t,"f",(function(){return x})),n.d(t,"g",(function(){return A})),n.d(t,"h",(function(){return z})),n.d(t,"i",(function(){return U})),n.d(t,"j",(function(){return B})),n.d(t,"k",(function(){return Z})),n.d(t,"l",(function(){return L}));var r=n(138),i=n(0),o=n.n(i),a=n(1),s=n.n(a),u=n(139),c=n(218),l=n(64),f=n(843),h=n.n(f),p=(n(873),n(118)),d=n(619),m=n.n(d),v=1073741823,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:{};function y(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var b=o.a.createContext||function(e,t){var n,i,a="__create-react-context-"+function(){var e="__global_unique_id__";return g[e]=(g[e]||0)+1}()+"__",u=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;i{t(e)}))}function a(e){return new s(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(r||(r={}));class s{constructor(e){s.prototype.__init.call(this),s.prototype.__init2.call(this),s.prototype.__init3.call(this),s.prototype.__init4.call(this),this._state=r.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new s(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new s(((t,n)=>{let r,i;return this.then((t=>{i=!1,r=t,e&&e()}),(t=>{i=!0,r=t,e&&e()})).then((()=>{i?n(r):t(r)}))}))}__init(){this._resolve=e=>{this._setResult(r.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(r.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===r.PENDING&&(Object(i.o)(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===r.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===r.RESOLVED&&e[1](this._value),this._state===r.REJECTED&&e[2](this._value),e[0]=!0)}))}}}},783:function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function m(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,n,r=p(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=d(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function O(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];w.redirect=function(e,t){if(-1===x.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function k(e,n){return new Promise((function(r,o){var a=new b(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new w(i,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}k.polyfill=!0,e.fetch||(e.fetch=k,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=k,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},792:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(38),o=n(409);function a(e){return new o.ApolloLink((function(t,n){return new i.Observable((function(r){var i,o,a;try{i=n(t).subscribe({next:function(i){i.errors&&(a=e({graphQLErrors:i.errors,response:i,operation:t,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.next(i)},error:function(i){(a=e({operation:t,networkError:i,graphQLErrors:i&&i.result&&i.result.errors||void 0,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.error(i)},complete:function(){a||r.complete.bind(r)()}})}catch(i){e({networkError:i,operation:t,forward:n}),r.error(i)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}}))}))}var s=function(e){function t(t){var n=e.call(this)||this;return n.link=a(t),n}return r.__extends(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)},t}(o.ApolloLink);t.ErrorLink=s,t.onError=a},793:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(10),i=n(42),o=n(86),a=n(388),s=n(411),u=n(117);function c(e,t,n,s){var u=t.data,c=Object(r.__rest)(t,["data"]),f=n.data,h=Object(r.__rest)(n,["data"]);return Object(i.a)(c,h)&&l(Object(o.e)(e).selectionSet,u,f,{fragmentMap:Object(a.a)(Object(o.d)(e)),variables:s})}function l(e,t,n,r){if(t===n)return!0;var o=new Set;return e.selections.every((function(e){if(o.has(e))return!0;if(o.add(e),!Object(s.g)(e,r.variables))return!0;if(f(e))return!0;if(Object(u.e)(e)){var c=Object(u.i)(e),h=t&&t[c],p=n&&n[c],d=e.selectionSet;if(!d)return Object(i.a)(h,p);var m=Array.isArray(h),v=Array.isArray(p);if(m!==v)return!1;if(m&&v){var g=h.length;if(p.length!==g)return!1;for(var y=0;y0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]-1&&(s=O(t)))return[2,s];try{if(function(e){if(!e)return!1;for(var t=0,n=e.length;t=194&&e[t]<=223){if(e[t+1]>>6==2){t+=2;continue}return!1}if((224===e[t]&&e[t+1]>=160&&e[t+1]<=191||237===e[t]&&e[t+1]>=128&&e[t+1]<=159)&&e[t+2]>>6==2)t+=3;else if((e[t]>=225&&e[t]<=236||e[t]>=238&&e[t]<=239)&&e[t+1]>>6==2&&e[t+2]>>6==2)t+=3;else{if(!(240===e[t]&&e[t+1]>=144&&e[t+1]<=191||e[t]>=241&&e[t]<=243&&e[t+1]>>6==2||244===e[t]&&e[t+1]>=128&&e[t+1]<=143)||e[t+2]>>6!=2||e[t+3]>>6!=2)return!1;t+=4}}return!0}(e))return[2,"text/plain"]}catch(e){console.warn("Additional mimetype checks (text/plain) are currently not supported for browsers")}return n?[2,n.mime]:[2,"application/octet-stream"]}}))}))},O=function(e){if(e&&0!==e.length){if(2===e.split("/").length)return e;e.indexOf(".")>-1&&(e=e.split(".").pop()),e=e.toLocaleLowerCase();for(var t=Object.keys(o),n=t.length,r=0;r-1)return t[r]}},w=function(e,t){if(void 0===t&&(t=!0),"boolean"==typeof t&&!t)return e;var n,r="boolean"!=typeof t&&t.replacement?t.replacement:"-",i="boolean"!=typeof t&&t.exclude?t.exclude:["\\","{","}","|","%","`",'"',"'","~","[","]","#","|","^","<",">"];if(!e||0===e.length)return"undefined";var o=e.split(".");return o.length>1&&(n=o.pop()),"".concat(o.join(".").split("").map((function(e){return i.indexOf(e)>-1?r:e})).join("")).concat(n?"."+n:"")},x=function(e,t){return t&&0!==t.length?0===Object.keys(e).length?e:Object.keys(e).filter((function(e){return t.indexOf(e)>-1})).reduce((function(t,n){var r;return Object(i.a)(Object(i.a)({},t),((r={})[n]=e[n],r))}),{}):e},k=function e(t){return t&&0!==Object.keys(t).length?(Object.keys(t).forEach((function(n){"function"==typeof t[n]&&(t[n]=void 0),t[n]===Object(t[n])&&(t[n]=e(t[n]))})),t):t}},function(e,t,n){n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));var r,i=n(0);!function(e){e.ABORTED="ABORTED",e.NETWORK="NETWORK",e.TIMEOUT="TIMEDOUT",e.SERVER="SERVER",e.REQUEST="REQUEST",e.OTHER="OTHER",e.REDIRECT="REDIRECT"}(r||(r={}));var o=function(e){function t(t,n,r,i){var o,a,s,u=this.constructor,c=e.call(this,t)||this;return c.config=n,c.response=r,c.code=i,o=c,a=u.prototype,(s=Object.setPrototypeOf)?s(o,a):o.__proto__=a,c}return Object(i.c)(t,e),t}(Error)},function(e,t,n){(function(r){var i;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)}},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(i=!1,function(){i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=n(57)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(27))},function(e,t,n){n.d(t,"a",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"i",(function(){return h})),n.d(t,"c",(function(){return r})),n.d(t,"g",(function(){return i}));var r=function(){return!1},i=function(){return!1};function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=function(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)},s=function(e){return null!==e&&"object"===o(e)},u=function(e){return"[object File]"===Object.prototype.toString.call(e)},c=function(e){return"[object Blob]"===Object.prototype.toString.call(e)},l=function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},f=function(e){return"undefined"!=typeof FormData&&e instanceof FormData},h=function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}},function(e,t,n){var r;n.d(t,"a",(function(){return r})),function(e){e.GET="GET",e.DELETE="DELETE",e.HEAD="HEAD",e.PURGE="PURGE",e.OPTIONS="OPTIONS",e.POST="POST",e.PUT="PUT",e.PATH="PATH"}(r||(r={}))},function(e,t,n){(function(e){n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(11),i={};function o(){return Object(r.b)()?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(e,t,n){var r=n||o(),i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}}).call(this,n(12))},function(e,t,n){var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},c.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r=0||(a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n))})),a):a},a=function(e,t,n,r){void 0===r&&(r=!1);var i=s(t);return e||(e={}),void 0===(e=JSON.parse(JSON.stringify(e)))[t]&&void 0===e[i]?e[i]=n:r&&(delete e[t],e[i]=n),e},s=function(e){return{"content-md5":"Content-MD5",dnt:"DNT",etag:"ETag","last-event-id":"Last-Event-ID",tcn:"TCN",te:"TE","www-authenticate":"WWW-Authenticate","x-dnsprefetch-control":"X-DNSPrefetch-Control"}[e.toLowerCase()]||e.split("-").map((function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})).join("-")},u=n(0),c=n(1),l=n(22),f=n(3),h=n.n(f)()("fs:request:data"),p=function(e){return e=d(e),Object(r.e)(e.data)||Object(r.c)(e.data)||Object(r.g)(e.data)||Object(r.d)(e.data)||Object(r.b)(e.data)||Object(r.a)(e.data)||(Object(r.h)(e.data)?(e.headers=a(e.headers,"content-type","application/x-www-form-urlencoded;charset=utf-8"),e.data=e.data.toString()):Object(r.f)(e.data)&&(e.headers=a(e.headers,"content-type","application/json",!0),e.data=JSON.stringify(e.data))),e},d=function(e){return e.filestackHeaders?(e.headers=a(e.headers,"filestack-source",Object(c.getVersion)()),e.headers=a(e.headers,"filestack-trace-id","".concat(Math.floor(Date.now()/1e3),"-").concat(Object(c.uniqueId)())),e.headers=a(e.headers,"filestack-trace-span","jssdk-".concat(Object(c.uniqueId)())),e):e},m=function(e){return Object(u.b)(void 0,void 0,void 0,(function(){var t,n;return Object(u.d)(this,(function(i){if(!e.headers||!e.headers["content-type"])return[2,Promise.resolve(e)];if(t=e.headers["content-type"],/application\/json/.test(t))try{e.data=JSON.parse(e.data)}catch(t){h("Cannot parse response %O - %O",e.data,e.headers)}else/text\/(plain|html)/.test(t)?Object(r.c)(e.data)&&(e.data=v(e.data)):/application\/xml/.test(t)&&(n=e.data,Object(r.c)(e.data)&&(n=v(e.data)),!0===l.XMLValidator.validate(n)&&(e.data=new l.XMLParser({ignoreDeclaration:!0,ignoreAttributes:!0,trimValues:!0}).parse(n)));return[2,Promise.resolve(e)]}))}))};function v(e){for(var t=new Uint16Array(e),n=t.length,r="",i=Math.pow(2,16)-1,o=0;on&&(i=n-o),r+=String.fromCharCode.apply(null,t.subarray(o,o+i));return r}var g=function(e,t){if(!t)return e;var n=y(t),r=e.indexOf("#");return-1!==r&&(e=e.slice(0,r)),e+(-1===e.indexOf("?")?"?":"&")+n},y=function(e){return Object.keys(e).filter((function(t){return t&&void 0!==e[t]})).map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))})).join("&")},b=n(13)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;var r=n(20);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return r.EndOfStreamError}});var i=n(48);Object.defineProperty(t,"StreamReader",{enumerable:!0,get:function(){return i.StreamReader}})},function(e,t,n){(function(e,r){n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var i=n(34);function o(){return!Object(i.a)()&&"[object process]"===Object.prototype.toString.call(void 0!==e?e:0)}function a(e,t){return e.require(t)}}).call(this,n(27),n(29)(e))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r},function(e,t,n){n.d(t,"a",(function(){return a}));var r=n(2),i=n(3),o=n.n(i)()("fs:request:shouldRetry"),a=function(e){switch(o("Checking error for retry. Code: %n, type: %s",e.response?e.response.status:"Malformed response",e.code),e.code){case r.b.NETWORK:case r.b.SERVER:case r.b.TIMEOUT:return!0;case r.b.ABORTED:return!1}return!!e.response&&500<=e.response.status&&e.response.status<=599}},function(e,t,n){var r=e.exports.Validator=n(35);e.exports.ValidatorResult=n(8).ValidatorResult,e.exports.ValidatorResultError=n(8).ValidatorResultError,e.exports.ValidationError=n(8).ValidationError,e.exports.SchemaError=n(8).SchemaError,e.exports.SchemaScanResult=n(16).SchemaScanResult,e.exports.scan=n(16).scan,e.exports.validate=function(e,t,n){return(new r).validate(e,t,n)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(36),o=n(37);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=O,t.resolve=function(e,t){return O(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?O(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=O(e)),e instanceof a?e.format():a.prototype.format.call(e)},t.Url=a;var s=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(l),h=["%","/","?",";","#"].concat(f),p=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(38);function O(e,t,n){if(e&&o.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+r(e));var a=e.indexOf("?"),u=-1!==a&&a127?Q+="x":Q+=$[I];if(!Q.match(d)){var D=A.slice(0,T),N=A.slice(T+1),F=$.match(m);F&&(D.push(F[1]),N.unshift(F[2])),N.length&&(O="/"+N.join(".")+O),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=i.toASCII(this.hostname));var L=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+L,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==O[0]&&(O="/"+O))}if(!v[k])for(T=0,R=f.length;T0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift())),n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var _=k.slice(-1)[0],P=(n.host||e.host||k.length>1)&&("."===_||".."===_)||""===_,E=0,T=k.length;T>=0;T--)"."===(_=k[T])?k.splice(T,1):".."===_?(k.splice(T,1),E++):E&&(k.splice(T,1),E--);if(!w&&!x)for(;E--;E)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),P&&"/"!==k.join("/").substr(-1)&&k.push("");var j,C=""===k[0]||k[0]&&"/"===k[0].charAt(0);return S&&(n.hostname=n.host=C?"":k.length?k.shift():"",(j=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift())),(w=w||n.host&&k.length)&&!C&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(15),o=n(8);function a(e,t){this.id=e,this.ref=t}e.exports.SchemaScanResult=a,e.exports.scan=function(e,t){function n(e,t){if(t&&"object"==r(t))if(t.$ref){var a=i.resolve(e,t.$ref);l[a]=l[a]?l[a]+1:0}else{var f=t.$id||t.id,h=f?i.resolve(e,f):e;if(h){if(h.indexOf("#")<0&&(h+="#"),c[h]){if(!o.deepCompareStrict(c[h],t))throw new Error("Schema <"+h+"> already exists with different definition");return c[h]}c[h]=t,"#"==h[h.length-1]&&(c[h.substring(0,h.length-1)]=t)}s(h+"/items",Array.isArray(t.items)?t.items:[t.items]),s(h+"/extends",Array.isArray(t.extends)?t.extends:[t.extends]),n(h+"/additionalItems",t.additionalItems),u(h+"/properties",t.properties),n(h+"/additionalProperties",t.additionalProperties),u(h+"/definitions",t.definitions),u(h+"/patternProperties",t.patternProperties),u(h+"/dependencies",t.dependencies),s(h+"/disallow",t.disallow),s(h+"/allOf",t.allOf),s(h+"/anyOf",t.anyOf),s(h+"/oneOf",t.oneOf),n(h+"/not",t.not)}}function s(e,t){if(Array.isArray(t))for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n1&&void 0!==a[1]?a[1]:this.position,o=e.alloc(n.len),t.next=4,this.readBuffer(o,{position:r});case 4:if(!(t.sent1&&void 0!==a[1]?a[1]:this.position,o=e.alloc(n.len),t.next=4,this.peekBuffer(o,{position:r});case 4:if(!(t.sentn)){e.next=5;break}return this.position+=n,e.abrupt("return",n);case 5:return this.position+=t,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"close",value:(o=a(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"normalizeOptions",value:function(e,t){if(t&&void 0!==t.position&&t.position=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return L(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return E(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function P(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function $(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function Q(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function I(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return o||I(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,o){return o||I(e,0,n,8),i.write(e,t,n,r,52,8),n+8}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return O(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Q(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Q(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(12))},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}function a(e,t,n){return(a=s()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.EndOfStreamError=t.defaultMessages=void 0,t.defaultMessages="End-Of-Stream";var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(l,e);var n,r,o,a=(n=l,r=s(),function(){var e,t=c(n);if(r){var o=c(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return i(this,e)});function l(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a.call(this,t.defaultMessages)}return o=l,Object.defineProperty(o,"prototype",{writable:!1}),o}(o(Error));t.EndOfStreamError=l},function(e,t,n){var r="[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+r+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t)for(var r=Object.keys(t),i=r.length,o=0;o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}),t.readFile=t.writeFileSync=t.writeFile=t.read=t.open=t.close=t.stat=t.createReadStream=t.pathExists=void 0;var s=n(43);function u(){return(u=a(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){s.stat(t,(function(t,r){t?n(t):e(r)}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(){return(c=a(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){s.close(t,(function(t){t?n(t):e()}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=a(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){s.open(t,n,(function(t,n){t?r(t):e(n)}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=a(i().mark((function e(t,n,r,o,a){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){s.read(t,n,r,o,a,(function(t,n,r){t?i(t):e({bytesRead:n,buffer:r})}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(){return(h=a(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){s.writeFile(t,n,(function(t){t?r(t):e()}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=a(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){s.readFile(t,(function(t,r){t?n(t):e(r)}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.pathExists=s.existsSync,t.createReadStream=s.createReadStream,t.stat=function(e){return u.apply(this,arguments)},t.close=function(e){return c.apply(this,arguments)},t.open=function(e,t){return l.apply(this,arguments)},t.read=function(e,t,n,r,i){return f.apply(this,arguments)},t.writeFile=function(e,t){return h.apply(this,arguments)},t.writeFileSync=function(e,t){s.writeFileSync(e,t)},t.readFile=function(e){return p.apply(this,arguments)}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n5&&"xml"===r)return h("InvalidXml","XML declaration allowed only at the start of the document.",d(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){var n=1;for(t+=8;t"===e[t]&&0==--n)break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t"===e[t+2]){t+=2;break}return t}function u(e,t){for(var n="",r="",i=!1;t"===e[t]&&""===r){i=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:i}}t.validate=function(e,t){t=Object.assign({},i,t);var n,c=[],p=!1,m=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(var v=0;v"!==e[v]&&" "!==e[v]&&"\t"!==e[v]&&"\n"!==e[v]&&"\r"!==e[v];v++)b+=e[v];if("/"===(b=b.trim())[b.length-1]&&(b=b.substring(0,b.length-1),v--),n=b,!r.isName(n))return h("InvalidTag",0===b.trim().length?"Invalid space after '<'.":"Tag '"+b+"' is an invalid name.",d(e,v));var O=u(e,v);if(!1===O)return h("InvalidAttr","Attributes for '"+b+"' have open quote.",d(e,v));var w=O.value;if(v=O.index,"/"===w[w.length-1]){var x=v-w.length,k=l(w=w.substring(0,w.length-1),t);if(!0!==k)return h(k.err.code,k.err.msg,d(e,x+k.err.line));p=!0}else if(y){if(!O.tagClosed)return h("InvalidTag","Closing tag '"+b+"' doesn't have proper closing.",d(e,v));if(w.trim().length>0)return h("InvalidTag","Closing tag '"+b+"' can't have attributes or invalid starting.",d(e,g));if(0===c.length)return h("InvalidTag","Closing tag '"+b+"' has not been opened.",d(e,g));var S=c.pop();if(b!==S.tagName){var _=d(e,S.tagStartPos);return h("InvalidTag","Expected closing tag '"+S.tagName+"' (opened in line "+_.line+", col "+_.col+") instead of closing tag '"+b+"'.",d(e,g))}0==c.length&&(m=!0)}else{var P=l(w,t);if(!0!==P)return h(P.err.code,P.err.msg,d(e,v-w.length+P.err.line));if(!0===m)return h("InvalidXml","Multiple possible root nodes found.",d(e,v));-1!==t.unpairedTags.indexOf(b)||c.push({tagName:b,tagStartPos:g}),p=!0}for(v++;v0)||h("InvalidXml","Invalid '"+JSON.stringify(c.map((function(e){return e.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};var c=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function l(e,t){for(var n=r.getAllMatches(e,c),i={},o=0;o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}var s=n(42),u=n(52);function c(){return(c=a(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.fromFile(t);case 2:return n=e.sent,e.prev=3,e.next=6,u.fromTokenizer(n);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,e.next=10,n.close();case 10:return e.finish(7);case 11:case"end":return e.stop()}}),e,null,[[3,,7,11]])})))).apply(this,arguments)}var l={fromFile:function(e){return c.apply(this,arguments)}};Object.assign(l,u),Object.defineProperty(l,"extensions",{get:function(){return u.extensions}}),Object.defineProperty(l,"mimeTypes",{get:function(){return u.mimeTypes}}),e.exports=l},function(e,t,n){var r,i,o;function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],r=e[1],i=e[2],o=e[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+t[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+t[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+t[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+t[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+t[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+t[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+t[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+t[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+t[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+t[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+t[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+t[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+t[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+t[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+t[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+t[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+t[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+t[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+t[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+t[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+t[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+t[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+t[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+t[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+t[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+t[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+t[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+t[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+t[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+t[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+t[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+t[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+t[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+t[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+t[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+t[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+t[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+t[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+t[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+t[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+t[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+t[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+t[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+t[9]-343485551|0)<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=o+e[3]|0}function r(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function i(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function o(e){var t,i,o,a,s,u,c=e.length,l=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(l,r(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(n(l,o),t=0;t<16;t+=1)o[t]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function a(e){var n,r="";for(n=0;n<4;n+=1)r+=t[e>>8*n+4&15]+t[e>>8*n&15];return r}function s(e){var t;for(t=0;tl?new ArrayBuffer(0):(i=l-c,o=new ArrayBuffer(i),a=new Uint8Array(o),s=new Uint8Array(this,c,i),a.set(s),o)}}(),l.prototype.append=function(e){return this.appendBinary(u(e)),this},l.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)n(this._hash,r(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},l.prototype.end=function(e){var t,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(o,i),n=s(this._hash),e&&(n=c(n)),this.reset(),n},l.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},l.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},l.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},l.prototype._finish=function(e,t){var r,i,o,a=t;if(e[a>>2]|=128<<(a%4<<3),a>55)for(n(this._hash,e),a=0;a<16;a+=1)e[a]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,e[14]=i,e[15]=o,n(this._hash,e)},l.hash=function(e,t){return l.hashBinary(u(e),t)},l.hashBinary=function(e,t){var n=s(o(e));return t?c(n):n},l.ArrayBuffer=function(){this.reset()},l.ArrayBuffer.prototype.append=function(e){var t,r,o,a,s=(r=this._buff.buffer,o=e,!0,(a=new Uint8Array(r.byteLength+o.byteLength)).set(new Uint8Array(r)),a.set(new Uint8Array(o),r.byteLength),a),u=s.length;for(this._length+=e.byteLength,t=64;t<=u;t+=64)n(this._hash,i(s.subarray(t-64,t)));return this._buff=t-64>2]|=r[t]<<(t%4<<3);return this._finish(o,i),n=s(this._hash),e&&(n=c(n)),this.reset(),n},l.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.ArrayBuffer.prototype.getState=function(){var e,t=l.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},l.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var n,r=e.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(n(l,o),t=0;t<16;t+=1)o[t]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}(new Uint8Array(e)));return t?c(r):r},l},"object"===a(t)?e.exports=o():void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){function r(){r=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:E(e,n,s)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",m="executing",v="completed",g={};function y(){}function b(){}function O(){}var w={};f(w,u,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(R([])));k&&k!==n&&i.call(k,u)&&(w=k);var S=O.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(r,o,s,u){var c=p(e[r],e,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==a(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var r;o(this,"_invoke",{value:function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}})}function E(t,n,r){var i=d;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=p(t,n,r);if("normal"===c.type){if(i=r.done?v:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=v,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=p(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n=1))throw new TypeError("Expected `intervalCap` to be a number from 1 and up, got `".concat(null!==(r=null===(n=e.intervalCap)||void 0===n?void 0:n.toString())&&void 0!==r?r:"","` (").concat(a(e.intervalCap),")"));if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError("Expected `interval` to be a finite number >= 0, got `".concat(null!==(o=null===(i=e.interval)||void 0===i?void 0:i.toString())&&void 0!==o?o:"","` (").concat(a(e.interval),")"));return t._carryoverConcurrencyCount=e.carryoverConcurrencyCount,t._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,t._intervalCap=e.intervalCap,t._interval=e.interval,t._queue=new e.queueClass,t._queueClass=e.queueClass,t.concurrency=e.concurrency,t._timeout=e.timeout,t._throwOnTimeout=!0===e.throwOnTimeout,t._isPaused=!1===e.autoStart,t}return t=y,(n=[{key:"_doesIntervalAllowAnother",get:function(){return this._isIntervalIgnored||this._intervalCount=1))throw new TypeError("Expected `concurrency` to be a number from 1 and up, got `".concat(e,"` (").concat(a(e),")"));this._concurrency=e,this._processQueue()}},{key:"add",value:(h=o(r().mark((function e(t){var n,i=this,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.abrupt("return",new Promise((function(e,a){var s=function(){var s=o(r().mark((function o(){var s;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i._pendingCount++,i._intervalCount++,r.prev=2,s=void 0===i._timeout&&void 0===n.timeout?t():d.default(Promise.resolve(t()),void 0===n.timeout?i._timeout:n.timeout,(function(){(void 0===n.throwOnTimeout?i._throwOnTimeout:n.throwOnTimeout)&&a(g)})),r.t0=e,r.next=7,s;case 7:r.t1=r.sent,(0,r.t0)(r.t1),r.next=14;break;case 11:r.prev=11,r.t2=r.catch(2),a(r.t2);case 14:i._next();case 15:case"end":return r.stop()}}),o,null,[[2,11]])})));return function(){return s.apply(this,arguments)}}();i._queue.enqueue(s,n),i._tryToStartAnother(),i.emit("add")})));case 2:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)})},{key:"addAll",value:(f=o(r().mark((function e(t,n){var i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t.map(function(){var e=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i.add(t,n));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return f.apply(this,arguments)})},{key:"start",value:function(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}},{key:"pause",value:function(){this._isPaused=!0}},{key:"clear",value:function(){this._queue=new this._queueClass}},{key:"onEmpty",value:(u=o(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this._queue.size){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",new Promise((function(e){var n=t._resolveEmpty;t._resolveEmpty=function(){n(),e()}})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"onIdle",value:(i=o(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this._pendingCount||0!==this._queue.size){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",new Promise((function(e){var n=t._resolveIdle;t._resolveIdle=function(){n(),e()}})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"size",get:function(){return this._queue.size}},{key:"sizeBy",value:function(e){return this._queue.filter(e).length}},{key:"pending",get:function(){return this._pendingCount}},{key:"isPaused",get:function(){return this._isPaused}},{key:"timeout",get:function(){return this._timeout},set:function(e){this._timeout=e}}])&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),y}(p);t.default=y},function(e,t,n){(function(e,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i="[object Arguments]",o="[object Function]",a="[object GeneratorFunction]",s="[object Map]",u="[object Set]",c=/\w*$/,l=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,h={};h[i]=h["[object Array]"]=h["[object ArrayBuffer]"]=h["[object DataView]"]=h["[object Boolean]"]=h["[object Date]"]=h["[object Float32Array]"]=h["[object Float64Array]"]=h["[object Int8Array]"]=h["[object Int16Array]"]=h["[object Int32Array]"]=h[s]=h["[object Number]"]=h["[object Object]"]=h["[object RegExp]"]=h[u]=h["[object String]"]=h["[object Symbol]"]=h["[object Uint8Array]"]=h["[object Uint8ClampedArray]"]=h["[object Uint16Array]"]=h["[object Uint32Array]"]=!0,h["[object Error]"]=h[o]=h["[object WeakMap]"]=!1;var p="object"==(void 0===e?"undefined":r(e))&&e&&e.Object===Object&&e,d="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,m=p||d||Function("return this")(),v="object"==r(t)&&t&&!t.nodeType&&t,g=v&&"object"==r(n)&&n&&!n.nodeType&&n,y=g&&g.exports===v;function b(e,t){return e.set(t[0],t[1]),e}function O(e,t){return e.add(t),e}function w(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i-1},ae.prototype.set=function(e,t){var n=this.__data__,r=le(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},se.prototype.clear=function(){this.__data__={hash:new oe,map:new(W||ae),string:new oe}},se.prototype.delete=function(e){return de(this,e).delete(e)},se.prototype.get=function(e){return de(this,e).get(e)},se.prototype.has=function(e){return de(this,e).has(e)},se.prototype.set=function(e,t){return de(this,e).set(e,t),this},ue.prototype.clear=function(){this.__data__=new ae},ue.prototype.delete=function(e){return this.__data__.delete(e)},ue.prototype.get=function(e){return this.__data__.get(e)},ue.prototype.has=function(e){return this.__data__.has(e)},ue.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ae){var r=n.__data__;if(!W||r.length<199)return r.push([e,t]),this;n=this.__data__=new se(r)}return n.set(e,t),this};var ve=U?S(U,Object):function(){return[]},ge=function(e){return Q.call(e)};function ye(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||f.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}(e.length)&&!_e(e)}var Se=B||function(){return!1};function _e(e){var t=Pe(e)?Q.call(e):"";return t==o||t==a}function Pe(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function Ee(e){return ke(e)?function(e,t){var n=xe(e)||function(e){return function(e){return function(e){return!!e&&"object"==r(e)}(e)&&ke(e)}(e)&&$.call(e,"callee")&&(!q.call(e,"callee")||Q.call(e)==i)}(e)?function(e,t){for(var n=-1,r=Array(e);++n",e);var u=a.objectGetPath(n.schemas[s],o.substr(1));if(void 0===u)throw new l("no such schema "+o+" located in <"+s+">",e);return{subschema:u,switchSchema:t}},h.prototype.testType=function(e,t,n,i,o){if(void 0!==o){if(null===o)throw new l('Unexpected null in "type" keyword');if("function"==typeof this.types[o])return this.types[o].call(this,e);if(o&&"object"==r(o)){var a=this.validateSchema(e,o,n,i);return void 0===a||!(a&&a.errors.length)}return!0}};var d=h.prototype.types={};d.string=function(e){return"string"==typeof e},d.number=function(e){return"number"==typeof e&&isFinite(e)},d.integer=function(e){return"number"==typeof e&&e%1==0},d.boolean=function(e){return"boolean"==typeof e},d.array=function(e){return Array.isArray(e)},d.null=function(e){return null===e},d.date=function(e){return e instanceof Date},d.any=function(e){return!0},d.object=function(e){return e&&"object"===r(e)&&!Array.isArray(e)&&!(e instanceof Date)},e.exports=h},function(e,t,n){(function(e,r){var i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(a){var s="object"==o(t)&&t&&!t.nodeType&&t,u="object"==o(e)&&e&&!e.nodeType&&e,c="object"==(void 0===r?"undefined":o(r))&&r;c.global!==c&&c.window!==c&&c.self!==c||(a=c);var l,f,h=2147483647,p=/^xn--/,d=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,y=String.fromCharCode;function b(e){throw RangeError(v[e])}function O(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function w(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+O((e=e.replace(m,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=y((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+y(e)})).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?g(e/700):e>>1,e+=g(e/t);e>455;r+=36)e=g(e/35);return g(r+36*e/(e+38))}function P(e){var t,n,r,i,o,a,s,u,c,l,f,p=[],d=e.length,m=0,v=128,y=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&b("not-basic"),p.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=d&&b("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>g((h-m)/a))&&b("overflow"),m+=u*a,!(u<(c=s<=y?1:s>=y+26?26:s-y));s+=36)a>g(h/(l=36-c))&&b("overflow"),a*=l;y=_(m-o,t=p.length+1,0==o),g(m/t)>h-v&&b("overflow"),v+=g(m/t),m%=t,p.splice(m++,0,v)}return k(p)}function E(e){var t,n,r,i,o,a,s,u,c,l,f,p,d,m,v,O=[];for(p=(e=x(e)).length,t=128,n=0,o=72,a=0;a=t&&fg((h-n)/(d=r+1))&&b("overflow"),n+=(s-t)*d,t=s,a=0;ah&&b("overflow"),f==t){for(u=n,c=36;!(u<(l=c<=o?1:c>=o+26?26:c-o));c+=36)v=u-l,m=36-l,O.push(y(S(l+v%m,0))),u=g(v/m);O.push(y(S(u,0))),o=_(n,d,r==i),n=0,++r}++n,++t}return O.join("")}if(l={version:"1.3.2",ucs2:{decode:x,encode:k},decode:P,encode:E,toASCII:function(e){return w(e,(function(e){return d.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return w(e,(function(e){return p.test(e)?P(e.slice(4).toLowerCase()):e}))}},"object"==o(n(25))&&n(25))void 0===(i=function(){return l}.call(t,n,t,e))||(e.exports=i);else if(s&&u)if(e.exports==s)u.exports=l;else for(f in l)l.hasOwnProperty(f)&&(s[f]=l[f]);else a.punycode=l}(this)}).call(this,n(24)(e),n(12))},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"===r(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){t.decode=t.parse=n(39),t.encode=t.stringify=n(40)},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l=0?(f=m.substr(0,v),h=m.substr(v+1)):(f=m,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),r(a,p)?i(a[p])?a[p].push(d):a[p]=[a[p],d]:a[p]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){switch(r(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,u){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===r(e)?a(s(e),(function(r){var s=encodeURIComponent(i(r))+n;return o(e[r])?a(e[r],(function(e){return s+encodeURIComponent(i(e))})).join(t):s+encodeURIComponent(i(e[r]))})).join(t):u?encodeURIComponent(i(u))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r":e+""}}));o.addError({name:"type",argument:s,message:"is not of a type(s) "+s})}return o},s.anyOf=function(e,t,n,r){if(void 0===e)return null;var a=new i(e,t,n,r),s=new i(e,t,n,r);if(!Array.isArray(t.anyOf))throw new o("anyOf must be an array");if(!t.anyOf.some(u.bind(this,e,n,r,(function(e){s.importErrors(e)})))){var c=t.anyOf.map((function(e,t){var n=e.$id||e.id;return n?"<"+n+">":e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));n.nestedErrors&&a.importErrors(s),a.addError({name:"anyOf",argument:c,message:"is not any of "+c.join(",")})}return a},s.allOf=function(e,t,n,r){if(void 0===e)return null;if(!Array.isArray(t.allOf))throw new o("allOf must be an array");var a=new i(e,t,n,r),s=this;return t.allOf.forEach((function(t,i){var o=s.validateSchema(e,t,n,r);if(!o.valid){var u=t.$id||t.id||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+i+"]";a.addError({name:"allOf",argument:{id:u,length:o.errors.length,valid:o},message:"does not match allOf schema "+u+" with "+o.errors.length+" error[s]:"}),a.importErrors(o)}})),a},s.oneOf=function(e,t,n,r){if(void 0===e)return null;if(!Array.isArray(t.oneOf))throw new o("oneOf must be an array");var a=new i(e,t,n,r),s=new i(e,t,n,r),c=t.oneOf.filter(u.bind(this,e,n,r,(function(e){s.importErrors(e)}))).length,l=t.oneOf.map((function(e,t){return e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));return 1!==c&&(n.nestedErrors&&a.importErrors(s),a.addError({name:"oneOf",argument:l,message:"is not exactly one from "+l.join(",")})),a},s.if=function(e,t,n,o){if(void 0===e)return null;if(!r.isSchema(t.if))throw new Error('Expected "if" keyword to be a schema');var a,s=u.call(this,e,n,o,null,t.if),c=new i(e,t,n,o);if(s){if(void 0===t.then)return;if(!r.isSchema(t.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,t.then,n,o.makeChild(t.then)),c.importErrors(a)}else{if(void 0===t.else)return;if(!r.isSchema(t.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,t.else,n,o.makeChild(t.else)),c.importErrors(a)}return c},s.propertyNames=function(e,t,n,a){if(this.types.object(e)){var s=new i(e,t,n,a),u=void 0!==t.propertyNames?t.propertyNames:{};if(!r.isSchema(u))throw new o('Expected "propertyNames" to be a schema (object or boolean)');for(var l in e)if(void 0!==c(e,l)){var f=this.validateSchema(l,u,n,a.makeChild(u));s.importErrors(f)}return s}},s.properties=function(e,t,n,r){if(this.types.object(e)){var a=new i(e,t,n,r),s=t.properties||{};for(var u in s){var l=s[u];if(void 0!==l){if(null===l)throw new o('Unexpected null, expected schema in "properties"');"function"==typeof n.preValidateProperty&&n.preValidateProperty(e,u,l,n,r);var f=c(e,u),h=this.validateSchema(f,l,n,r.makeChild(l,u));h.instance!==a.instance[u]&&(a.instance[u]=h.instance),a.importErrors(h)}}return a}},s.patternProperties=function(e,t,n,r){if(this.types.object(e)){var a=new i(e,t,n,r),s=t.patternProperties||{};for(var u in e){var c=!0;for(var f in s){var h=s[f];if(void 0!==h){if(null===h)throw new o('Unexpected null, expected schema in "patternProperties"');try{var p=new RegExp(f,"u")}catch(e){p=new RegExp(f)}if(p.test(u)){c=!1,"function"==typeof n.preValidateProperty&&n.preValidateProperty(e,u,h,n,r);var d=this.validateSchema(e[u],h,n,r.makeChild(h,u));d.instance!==a.instance[u]&&(a.instance[u]=d.instance),a.importErrors(d)}}}c&&l.call(this,e,t,n,r,u,a)}return a}},s.additionalProperties=function(e,t,n,r){if(this.types.object(e)){if(t.patternProperties)return null;var o=new i(e,t,n,r);for(var a in e)l.call(this,e,t,n,r,a,o);return o}},s.minProperties=function(e,t,n,r){if(this.types.object(e)){var o=new i(e,t,n,r);return Object.keys(e).length>=t.minProperties||o.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),o}},s.maxProperties=function(e,t,n,r){if(this.types.object(e)){var o=new i(e,t,n,r);return Object.keys(e).length<=t.maxProperties||o.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),o}},s.items=function(e,t,n,r){var o=this;if(this.types.array(e)&&void 0!==t.items){var a=new i(e,t,n,r);return e.every((function(e,i){if(Array.isArray(t.items))var s=void 0===t.items[i]?t.additionalItems:t.items[i];else s=t.items;if(void 0===s)return!0;if(!1===s)return a.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(e,s,n,r.makeChild(s,i));return u.instance!==a.instance[i]&&(a.instance[i]=u.instance),a.importErrors(u),!0})),a}},s.contains=function(e,t,n,o){var a=this;if(this.types.array(e)&&void 0!==t.contains){if(!r.isSchema(t.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new i(e,t,n,o);return!1===e.some((function(e,r){return 0===a.validateSchema(e,t.contains,n,o.makeChild(t.contains,r)).errors.length}))&&s.addError({name:"contains",argument:t.contains,message:"must contain an item matching given schema"}),s}},s.minimum=function(e,t,n,r){if(this.types.number(e)){var o=new i(e,t,n,r);return t.exclusiveMinimum&&!0===t.exclusiveMinimum?e>t.minimum||o.addError({name:"minimum",argument:t.minimum,message:"must be greater than "+t.minimum}):e>=t.minimum||o.addError({name:"minimum",argument:t.minimum,message:"must be greater than or equal to "+t.minimum}),o}},s.maximum=function(e,t,n,r){if(this.types.number(e)){var o=new i(e,t,n,r);return t.exclusiveMaximum&&!0===t.exclusiveMaximum?et.exclusiveMinimum||o.addError({name:"exclusiveMinimum",argument:t.exclusiveMinimum,message:"must be strictly greater than "+t.exclusiveMinimum}),o}},s.exclusiveMaximum=function(e,t,n,r){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var o=new i(e,t,n,r);return e=t.minLength||o.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),o}},s.maxLength=function(e,t,n,r){if(this.types.string(e)){var o=new i(e,t,n,r),a=e.match(/[\uDC00-\uDFFF]/g);return e.length-(a?a.length:0)<=t.maxLength||o.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),o}},s.minItems=function(e,t,n,r){if(this.types.array(e)){var o=new i(e,t,n,r);return e.length>=t.minItems||o.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),o}},s.maxItems=function(e,t,n,r){if(this.types.array(e)){var o=new i(e,t,n,r);return e.length<=t.maxItems||o.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),o}},s.uniqueItems=function(e,t,n,r){if(!0===t.uniqueItems&&this.types.array(e)){var o=new i(e,t,n,r);return e.every(h)||o.addError({name:"uniqueItems",message:"contains duplicate item"}),o}},s.dependencies=function(e,t,n,r){if(this.types.object(e)){var o=new i(e,t,n,r);for(var a in t.dependencies)if(void 0!==e[a]){var s=t.dependencies[a],u=r.makeChild(s,a);if("string"==typeof s&&(s=[s]),Array.isArray(s))s.forEach((function(t){void 0===e[t]&&o.addError({name:"dependencies",argument:u.propertyPath,message:"property "+t+" not found, required by "+u.propertyPath})}));else{var c=this.validateSchema(e,s,n,u);o.instance!==c.instance&&(o.instance=c.instance),c&&c.errors.length&&(o.addError({name:"dependencies",argument:u.propertyPath,message:"does not meet dependency required by "+u.propertyPath}),o.importErrors(c))}}return o}},s.enum=function(e,t,n,a){if(void 0===e)return null;if(!Array.isArray(t.enum))throw new o("enum expects an array",t);var s=new i(e,t,n,a);return t.enum.some(r.deepCompareStrict.bind(null,e))||s.addError({name:"enum",argument:t.enum,message:"is not one of enum values: "+t.enum.map(String).join(",")}),s},s.const=function(e,t,n,o){if(void 0===e)return null;var a=new i(e,t,n,o);return r.deepCompareStrict(t.const,e)||a.addError({name:"const",argument:t.const,message:"does not exactly match expected constant: "+t.const}),a},s.not=s.disallow=function(e,t,n,r){var o=this;if(void 0===e)return null;var a=new i(e,t,n,r),s=t.not||t.disallow;return s?(Array.isArray(s)||(s=[s]),s.forEach((function(i){if(o.testType(e,t,n,r,i)){var s=i&&(i.$id||i.id)||i;a.addError({name:"not",argument:s,message:"is of prohibited type "+s})}})),a):null},e.exports=a},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){i=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),s=new A(r||[]);return a(o,"_invoke",{value:E(e,n,s)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",m="executing",v="completed",g={};function y(){}function b(){}function O(){}var w={};f(w,u,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(R([])));k&&k!==n&&o.call(k,u)&&(w=k);var S=O.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,a,s,u){var c=p(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(t,n,r){var i=d;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=p(t,n,r);if("normal"===c.type){if(i=r.done?v:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=v,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=p(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}Object.defineProperty(t,"__esModule",{value:!0}),t.fromStream=t.fromBuffer=t.EndOfStreamError=t.fromFile=void 0;var s=n(26),u=n(17),c=n(51);Object.defineProperty(t,"fromFile",{enumerable:!0,get:function(){return c.fromFile}});var l=n(17);function f(){return(f=a(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=n||{},!t.path){e.next=7;break}return e.next=4,s.stat(t.path);case 4:r=e.sent,n.path=t.path,n.size=r.size;case 7:return e.abrupt("return",u.fromStream(t,n));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return l.EndOfStreamError}}),Object.defineProperty(t,"fromBuffer",{enumerable:!0,get:function(){return l.fromBuffer}}),t.fromStream=function(e,t){return f.apply(this,arguments)}},function(e,t){},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){i=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),s=new A(r||[]);return a(o,"_invoke",{value:E(e,n,s)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",m="executing",v="completed",g={};function y(){}function b(){}function O(){}var w={};f(w,u,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(R([])));k&&k!==n&&o.call(k,u)&&(w=k);var S=O.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,a,s,u){var c=p(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(t,n,r){var i=d;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=p(t,n,r);if("normal"===c.type){if(i=r.done?v:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=v,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=p(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n0)){e.next=8;break}return e.next=5,this.ignore(o);case 5:return e.abrupt("return",this.readBuffer(t,n));case 8:if(!(o<0)){e.next=10;break}throw new Error("`options.position` must be equal or greater than `tokenizer.position`");case 10:if(0!==r.length){e.next=12;break}return e.abrupt("return",0);case 12:return e.next=14,this.streamReader.read(t,r.offset,r.length);case 14:if(a=e.sent,this.position+=a,n&&n.mayBeLess||!(a0)){e.next=13;break}return s=new Uint8Array(r.length+a),e.next=8,this.peekBuffer(s,{mayBeLess:r.mayBeLess});case 8:return o=e.sent,t.set(s.subarray(a),r.offset),e.abrupt("return",o-a);case 13:if(!(a<0)){e.next=15;break}throw new Error("Cannot peek from a negative offset in a stream");case 15:if(!(r.length>0)){e.next=29;break}return e.prev=16,e.next=19,this.streamReader.peek(t,r.offset,r.length);case 19:o=e.sent,e.next=27;break;case 22:if(e.prev=22,e.t0=e.catch(16),!(n&&n.mayBeLess&&e.t0 instanceof d.EndOfStreamError)){e.next=26;break}return e.abrupt("return",0);case 26:throw e.t0;case 27:if(r.mayBeLess||!(o0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,c-=8);e[n+p-d]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){i=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),s=new A(r||[]);return a(o,"_invoke",{value:E(e,n,s)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",m="executing",v="completed",g={};function y(){}function b(){}function O(){}var w={};f(w,u,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(R([])));k&&k!==n&&o.call(k,u)&&(w=k);var S=O.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,a,s,u){var c=p(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(t,n,r){var i=d;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=p(t,n,r);if("normal"===c.type){if(i=r.done?v:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=v,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=p(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n0&&o>0)){e.next=17;break}if(s=this.peekQueue.pop()){e.next=10;break}throw new Error("peekData should be defined");case 10:u=Math.min(s.length,o),t.set(s.subarray(0,u),n+a),a+=u,o-=u,u0)||this.endOfStream){e.next=28;break}return l=Math.min(o,1048576),e.next=21,this.readFromStream(t,n+a,l);case 21:if(f=e.sent,a+=f,!(f=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:C(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1){e.next=5;break}return e.abrupt("return");case 5:return r=strtok3.fromBuffer(n),e.abrupt("return",fromTokenizer(r));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _check(e,t,n){n=_objectSpread({offset:0},n);var r,i=_createForOfIteratorHelper(t.entries());try{for(i.s();!(r=i.n()).done;){var o=_slicedToArray(r.value,2),a=o[0],s=o[1];if(n.mask){if(s!==(n.mask[a]&e[a+n.offset]))return!1}else if(s!==e[a+n.offset])return!1}}catch(e){i.e(e)}finally{i.f()}return!0}function fromTokenizer(e){return _fromTokenizer2.apply(this,arguments)}function _fromTokenizer2(){return(_fromTokenizer2=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",_fromTokenizer(t));case 4:if(e.prev=4,e.t0=e.catch(0),e.t0 instanceof strtok3.EndOfStreamError){e.next=8;break}throw e.t0;case 8:case"end":return e.stop()}}),e,null,[[0,4]])})))).apply(this,arguments)}function _fromTokenizer(e){return _fromTokenizer3.apply(this,arguments)}function _fromTokenizer3(){return(_fromTokenizer3=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n,r,i,o,a,s,u,c,l,f,h,p,d,m,v,g,y,b,O,w,x,k,S,_,P,E,T,j,C,A;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Buffer.alloc(minimumBytes),r=function(e,t){return _check(n,e,t)},i=function(e,t){return r(stringToBytes(e),t)},t.fileInfo.size||(t.fileInfo.size=Number.MAX_SAFE_INTEGER),e.next=7,t.peekBuffer(n,{length:12,mayBeLess:!0});case 7:if(!r([66,77])){e.next=9;break}return e.abrupt("return",{ext:"bmp",mime:"image/bmp"});case 9:if(!r([11,119])){e.next=11;break}return e.abrupt("return",{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"});case 11:if(!r([120,1])){e.next=13;break}return e.abrupt("return",{ext:"dmg",mime:"application/x-apple-diskimage"});case 13:if(!r([77,90])){e.next=15;break}return e.abrupt("return",{ext:"exe",mime:"application/x-msdownload"});case 15:if(!r([37,33])){e.next=21;break}return e.next=18,t.peekBuffer(n,{length:24,mayBeLess:!0});case 18:if(!i("PS-Adobe-",{offset:2})||!i(" EPSF-",{offset:14})){e.next=20;break}return e.abrupt("return",{ext:"eps",mime:"application/eps"});case 20:return e.abrupt("return",{ext:"ps",mime:"application/postscript"});case 21:if(!r([31,160])&&!r([31,157])){e.next=23;break}return e.abrupt("return",{ext:"Z",mime:"application/x-compress"});case 23:if(!r([255,216,255])){e.next=25;break}return e.abrupt("return",{ext:"jpg",mime:"image/jpeg"});case 25:if(!r([73,73,188])){e.next=27;break}return e.abrupt("return",{ext:"jxr",mime:"image/vnd.ms-photo"});case 27:if(!r([31,139,8])){e.next=29;break}return e.abrupt("return",{ext:"gz",mime:"application/gzip"});case 29:if(!r([66,90,104])){e.next=31;break}return e.abrupt("return",{ext:"bz2",mime:"application/x-bzip2"});case 31:if(!i("ID3")){e.next=42;break}return e.next=34,t.ignore(6);case 34:return e.next=36,t.readToken(uint32SyncSafeToken);case 36:if(o=e.sent,!(t.position+o>t.fileInfo.size)){e.next=39;break}return e.abrupt("return",{ext:"mp3",mime:"audio/mpeg"});case 39:return e.next=41,t.ignore(o);case 41:return e.abrupt("return",fromTokenizer(t));case 42:if(!i("MP+")){e.next=44;break}return e.abrupt("return",{ext:"mpc",mime:"audio/x-musepack"});case 44:if(67!==n[0]&&70!==n[0]||!r([87,83],{offset:1})){e.next=46;break}return e.abrupt("return",{ext:"swf",mime:"application/x-shockwave-flash"});case 46:if(!r([71,73,70])){e.next=48;break}return e.abrupt("return",{ext:"gif",mime:"image/gif"});case 48:if(!i("FLIF")){e.next=50;break}return e.abrupt("return",{ext:"flif",mime:"image/flif"});case 50:if(!i("8BPS")){e.next=52;break}return e.abrupt("return",{ext:"psd",mime:"image/vnd.adobe.photoshop"});case 52:if(!i("WEBP",{offset:8})){e.next=54;break}return e.abrupt("return",{ext:"webp",mime:"image/webp"});case 54:if(!i("MPCK")){e.next=56;break}return e.abrupt("return",{ext:"mpc",mime:"audio/x-musepack"});case 56:if(!i("FORM")){e.next=58;break}return e.abrupt("return",{ext:"aif",mime:"audio/aiff"});case 58:if(!i("icns",{offset:0})){e.next=60;break}return e.abrupt("return",{ext:"icns",mime:"image/icns"});case 60:if(!r([80,75,3,4])){e.next=121;break}e.prev=61;case 62:if(!(t.position+30=0?c:n.length);case 106:e.next=100;break;case 108:e.next=112;break;case 110:return e.next=112,t.ignore(a.compressedSize);case 112:e.next=62;break;case 114:e.next=120;break;case 116:if(e.prev=116,e.t2=e.catch(61),e.t2 instanceof strtok3.EndOfStreamError){e.next=120;break}throw e.t2;case 120:return e.abrupt("return",{ext:"zip",mime:"application/zip"});case 121:if(!i("OggS")){e.next=140;break}return e.next=124,t.ignore(28);case 124:return l=Buffer.alloc(8),e.next=127,t.readBuffer(l);case 127:if(!_check(l,[79,112,117,115,72,101,97,100])){e.next=129;break}return e.abrupt("return",{ext:"opus",mime:"audio/opus"});case 129:if(!_check(l,[128,116,104,101,111,114,97])){e.next=131;break}return e.abrupt("return",{ext:"ogv",mime:"video/ogg"});case 131:if(!_check(l,[1,118,105,100,101,111,0])){e.next=133;break}return e.abrupt("return",{ext:"ogm",mime:"video/ogg"});case 133:if(!_check(l,[127,70,76,65,67])){e.next=135;break}return e.abrupt("return",{ext:"oga",mime:"audio/ogg"});case 135:if(!_check(l,[83,112,101,101,120,32,32])){e.next=137;break}return e.abrupt("return",{ext:"spx",mime:"audio/ogg"});case 137:if(!_check(l,[1,118,111,114,98,105,115])){e.next=139;break}return e.abrupt("return",{ext:"ogg",mime:"audio/ogg"});case 139:return e.abrupt("return",{ext:"ogx",mime:"application/ogg"});case 140:if(!r([80,75])||3!==n[2]&&5!==n[2]&&7!==n[2]||4!==n[3]&&6!==n[3]&&8!==n[3]){e.next=142;break}return e.abrupt("return",{ext:"zip",mime:"application/zip"});case 142:if(!i("ftyp",{offset:4})||0==(96&n[8])){e.next=167;break}f=n.toString("binary",8,12).replace("\0"," ").trim(),e.t3=f,e.next="avif"===e.t3?147:"mif1"===e.t3?148:"msf1"===e.t3?149:"heic"===e.t3||"heix"===e.t3?150:"hevc"===e.t3||"hevx"===e.t3?151:"qt"===e.t3?152:"M4V"===e.t3||"M4VH"===e.t3||"M4VP"===e.t3?153:"M4P"===e.t3?154:"M4B"===e.t3?155:"M4A"===e.t3?156:"F4V"===e.t3?157:"F4P"===e.t3?158:"F4A"===e.t3?159:"F4B"===e.t3?160:"crx"===e.t3?161:162;break;case 147:return e.abrupt("return",{ext:"avif",mime:"image/avif"});case 148:return e.abrupt("return",{ext:"heic",mime:"image/heif"});case 149:return e.abrupt("return",{ext:"heic",mime:"image/heif-sequence"});case 150:return e.abrupt("return",{ext:"heic",mime:"image/heic"});case 151:return e.abrupt("return",{ext:"heic",mime:"image/heic-sequence"});case 152:return e.abrupt("return",{ext:"mov",mime:"video/quicktime"});case 153:return e.abrupt("return",{ext:"m4v",mime:"video/x-m4v"});case 154:return e.abrupt("return",{ext:"m4p",mime:"video/mp4"});case 155:return e.abrupt("return",{ext:"m4b",mime:"audio/mp4"});case 156:return e.abrupt("return",{ext:"m4a",mime:"audio/x-m4a"});case 157:return e.abrupt("return",{ext:"f4v",mime:"video/mp4"});case 158:return e.abrupt("return",{ext:"f4p",mime:"video/mp4"});case 159:return e.abrupt("return",{ext:"f4a",mime:"audio/mp4"});case 160:return e.abrupt("return",{ext:"f4b",mime:"audio/mp4"});case 161:return e.abrupt("return",{ext:"cr3",mime:"image/x-canon-cr3"});case 162:if(!f.startsWith("3g")){e.next=166;break}if(!f.startsWith("3g2")){e.next=165;break}return e.abrupt("return",{ext:"3g2",mime:"video/3gpp2"});case 165:return e.abrupt("return",{ext:"3gp",mime:"video/3gpp"});case 166:return e.abrupt("return",{ext:"mp4",mime:"video/mp4"});case 167:if(!i("MThd")){e.next=169;break}return e.abrupt("return",{ext:"mid",mime:"audio/midi"});case 169:if(!i("wOFF")||!r([0,1,0,0],{offset:4})&&!i("OTTO",{offset:4})){e.next=171;break}return e.abrupt("return",{ext:"woff",mime:"font/woff"});case 171:if(!i("wOF2")||!r([0,1,0,0],{offset:4})&&!i("OTTO",{offset:4})){e.next=173;break}return e.abrupt("return",{ext:"woff2",mime:"font/woff2"});case 173:if(!r([212,195,178,161])&&!r([161,178,195,212])){e.next=175;break}return e.abrupt("return",{ext:"pcap",mime:"application/vnd.tcpdump.pcap"});case 175:if(!i("DSD ")){e.next=177;break}return e.abrupt("return",{ext:"dsf",mime:"audio/x-dsf"});case 177:if(!i("LZIP")){e.next=179;break}return e.abrupt("return",{ext:"lz",mime:"application/x-lzip"});case 179:if(!i("fLaC")){e.next=181;break}return e.abrupt("return",{ext:"flac",mime:"audio/x-flac"});case 181:if(!r([66,80,71,251])){e.next=183;break}return e.abrupt("return",{ext:"bpg",mime:"image/bpg"});case 183:if(!i("wvpk")){e.next=185;break}return e.abrupt("return",{ext:"wv",mime:"audio/wavpack"});case 185:if(!i("%PDF")){e.next=195;break}return e.next=188,t.ignore(1350);case 188:return h=Buffer.alloc(Math.min(10485760,t.fileInfo.size)),e.next=192,t.readBuffer(h,{mayBeLess:!0});case 192:if(!h.includes(Buffer.from("AIPrivateData"))){e.next=194;break}return e.abrupt("return",{ext:"ai",mime:"application/postscript"});case 194:return e.abrupt("return",{ext:"pdf",mime:"application/pdf"});case 195:if(!r([0,97,115,109])){e.next=197;break}return e.abrupt("return",{ext:"wasm",mime:"application/wasm"});case 197:if(!r([73,73,42,0])){e.next=210;break}if(!i("CR",{offset:8})){e.next=200;break}return e.abrupt("return",{ext:"cr2",mime:"image/x-canon-cr2"});case 200:if(!r([28,0,254,0],{offset:8})&&!r([31,0,11,0],{offset:8})){e.next=202;break}return e.abrupt("return",{ext:"nef",mime:"image/x-nikon-nef"});case 202:if(!r([8,0,0,0],{offset:4})||!r([45,0,254,0],{offset:8})&&!r([39,0,254,0],{offset:8})){e.next=204;break}return e.abrupt("return",{ext:"dng",mime:"image/x-adobe-dng"});case 204:return n=Buffer.alloc(24),e.next=207,t.peekBuffer(n);case 207:if(!r([16,251,134,1],{offset:4})&&!r([8,0,0,0],{offset:4})||!r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})){e.next=209;break}return e.abrupt("return",{ext:"arw",mime:"image/x-sony-arw"});case 209:return e.abrupt("return",{ext:"tif",mime:"image/tiff"});case 210:if(!r([77,77,0,42])){e.next=212;break}return e.abrupt("return",{ext:"tif",mime:"image/tiff"});case 212:if(!i("MAC ")){e.next=214;break}return e.abrupt("return",{ext:"ape",mime:"audio/ape"});case 214:if(!r([26,69,223,163])){e.next=233;break}return y=function(){return(y=_asyncToGenerator(_regeneratorRuntime().mark((function e(n,r){var i;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r>0)){e.next=11;break}return e.next=3,m();case 3:if(17026!==(i=e.sent).id){e.next=6;break}return e.abrupt("return",t.readToken(new Token.StringType(i.len,"utf-8")));case 6:return e.next=8,t.ignore(i.len);case 8:--r,e.next=0;break;case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e,t){return y.apply(this,arguments)},v=function(){return(v=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p();case 2:return t=e.sent,e.next=5,p();case 5:return(n=e.sent)[0]^=128>>n.length-1,r=Math.min(6,n.length),e.abrupt("return",{id:t.readUIntBE(0,t.length),len:n.readUIntBE(n.length-r,r)});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)},m=function(){return v.apply(this,arguments)},d=function(){return(d=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var n,r,i,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.peekNumber(Token.UINT8);case 2:for(n=e.sent,r=128,i=0;0==(n&r)&&0!==r;)++i,r>>=1;return o=Buffer.alloc(i+1),e.next=9,t.readBuffer(o);case 9:return e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)},p=function(){return d.apply(this,arguments)},e.next=223,m();case 223:return b=e.sent,e.next=226,g(1,b.len);case 226:O=e.sent,e.t4=O,e.next="webm"===e.t4?230:"matroska"===e.t4?231:232;break;case 230:return e.abrupt("return",{ext:"webm",mime:"video/webm"});case 231:return e.abrupt("return",{ext:"mkv",mime:"video/x-matroska"});case 232:return e.abrupt("return");case 233:if(!r([82,73,70,70])){e.next=240;break}if(!r([65,86,73],{offset:8})){e.next=236;break}return e.abrupt("return",{ext:"avi",mime:"video/vnd.avi"});case 236:if(!r([87,65,86,69],{offset:8})){e.next=238;break}return e.abrupt("return",{ext:"wav",mime:"audio/vnd.wave"});case 238:if(!r([81,76,67,77],{offset:8})){e.next=240;break}return e.abrupt("return",{ext:"qcp",mime:"audio/qcelp"});case 240:if(!i("SQLi")){e.next=242;break}return e.abrupt("return",{ext:"sqlite",mime:"application/x-sqlite3"});case 242:if(!r([78,69,83,26])){e.next=244;break}return e.abrupt("return",{ext:"nes",mime:"application/x-nintendo-nes-rom"});case 244:if(!i("Cr24")){e.next=246;break}return e.abrupt("return",{ext:"crx",mime:"application/x-google-chrome-extension"});case 246:if(!i("MSCF")&&!i("ISc(")){e.next=248;break}return e.abrupt("return",{ext:"cab",mime:"application/vnd.ms-cab-compressed"});case 248:if(!r([237,171,238,219])){e.next=250;break}return e.abrupt("return",{ext:"rpm",mime:"application/x-rpm"});case 250:if(!r([197,208,211,198])){e.next=252;break}return e.abrupt("return",{ext:"eps",mime:"application/eps"});case 252:if(!r([40,181,47,253])){e.next=254;break}return e.abrupt("return",{ext:"zst",mime:"application/zstd"});case 254:if(!r([79,84,84,79,0])){e.next=256;break}return e.abrupt("return",{ext:"otf",mime:"font/otf"});case 256:if(!i("#!AMR")){e.next=258;break}return e.abrupt("return",{ext:"amr",mime:"audio/amr"});case 258:if(!i("{\\rtf")){e.next=260;break}return e.abrupt("return",{ext:"rtf",mime:"application/rtf"});case 260:if(!r([70,76,86,1])){e.next=262;break}return e.abrupt("return",{ext:"flv",mime:"video/x-flv"});case 262:if(!i("IMPM")){e.next=264;break}return e.abrupt("return",{ext:"it",mime:"audio/x-it"});case 264:if(!(i("-lh0-",{offset:2})||i("-lh1-",{offset:2})||i("-lh2-",{offset:2})||i("-lh3-",{offset:2})||i("-lh4-",{offset:2})||i("-lh5-",{offset:2})||i("-lh6-",{offset:2})||i("-lh7-",{offset:2})||i("-lzs-",{offset:2})||i("-lz4-",{offset:2})||i("-lz5-",{offset:2})||i("-lhd-",{offset:2}))){e.next=266;break}return e.abrupt("return",{ext:"lzh",mime:"application/x-lzh-compressed"});case 266:if(!r([0,0,1,186])){e.next=271;break}if(!r([33],{offset:4,mask:[241]})){e.next=269;break}return e.abrupt("return",{ext:"mpg",mime:"video/MP1S"});case 269:if(!r([68],{offset:4,mask:[196]})){e.next=271;break}return e.abrupt("return",{ext:"mpg",mime:"video/MP2P"});case 271:if(!i("ITSF")){e.next=273;break}return e.abrupt("return",{ext:"chm",mime:"application/vnd.ms-htmlhelp"});case 273:if(!r([253,55,122,88,90,0])){e.next=275;break}return e.abrupt("return",{ext:"xz",mime:"application/x-xz"});case 275:if(!i("")){e.next=294;break}return e.next=288,t.ignore(8);case 288:return e.next=290,t.readToken(new Token.StringType(13,"ascii"));case 290:if("debian-binary"!==e.sent){e.next=293;break}return e.abrupt("return",{ext:"deb",mime:"application/x-deb"});case 293:return e.abrupt("return",{ext:"ar",mime:"application/x-unix-archive"});case 294:if(!r([137,80,78,71,13,10,26,10])){e.next=313;break}return x=function(){return(x=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.readToken(Token.INT32_BE);case 2:return e.t0=e.sent,e.next=5,t.readToken(new Token.StringType(4,"binary"));case 5:return e.t1=e.sent,e.abrupt("return",{length:e.t0,type:e.t1});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)},w=function(){return x.apply(this,arguments)},e.next=299,t.ignore(8);case 299:return e.next=301,w();case 301:if(!((k=e.sent).length<0)){e.next=304;break}return e.abrupt("return");case 304:e.t5=k.type,e.next="IDAT"===e.t5?307:"acTL"===e.t5?308:309;break;case 307:return e.abrupt("return",{ext:"png",mime:"image/png"});case 308:return e.abrupt("return",{ext:"apng",mime:"image/apng"});case 309:return e.next=311,t.ignore(k.length+4);case 311:if(t.position+8=16)){e.next=408;break}if(!((C=n.readUInt32LE(12))>12&&n.length>=C+16)){e.next=408;break}if(e.prev=399,A=n.slice(16,C+16).toString(),!JSON.parse(A).files){e.next=404;break}return e.abrupt("return",{ext:"asar",mime:"application/x-asar"});case 404:e.next=408;break;case 406:e.prev=406,e.t8=e.catch(399);case 408:if(!r([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){e.next=410;break}return e.abrupt("return",{ext:"mxf",mime:"application/mxf"});case 410:if(!i("SCRM",{offset:44})){e.next=412;break}return e.abrupt("return",{ext:"s3m",mime:"audio/x-s3m"});case 412:if(!r([71],{offset:4})||!r([71],{offset:192})&&!r([71],{offset:196})){e.next=414;break}return e.abrupt("return",{ext:"mts",mime:"video/mp2t"});case 414:if(!r([66,79,79,75,77,79,66,73],{offset:60})){e.next=416;break}return e.abrupt("return",{ext:"mobi",mime:"application/x-mobipocket-ebook"});case 416:if(!r([68,73,67,77],{offset:128})){e.next=418;break}return e.abrupt("return",{ext:"dcm",mime:"application/dicom"});case 418:if(!r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70])){e.next=420;break}return e.abrupt("return",{ext:"lnk",mime:"application/x.ms.shortcut"});case 420:if(!r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0])){e.next=422;break}return e.abrupt("return",{ext:"alias",mime:"application/x.apple.alias"});case 422:if(!r([76,80],{offset:34})||!(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8}))){e.next=424;break}return e.abrupt("return",{ext:"eot",mime:"application/vnd.ms-fontobject"});case 424:if(!r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29])){e.next=426;break}return e.abrupt("return",{ext:"indd",mime:"application/x-indesign"});case 426:return e.next=428,t.peekBuffer(n,{length:Math.min(512,t.fileInfo.size),mayBeLess:!0});case 428:if(!tarHeaderChecksumMatches(n)){e.next=430;break}return e.abrupt("return",{ext:"tar",mime:"application/x-tar"});case 430:if(!r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0])){e.next=432;break}return e.abrupt("return",{ext:"skp",mime:"application/vnd.sketchup.skp"});case 432:if(!i("-----BEGIN PGP MESSAGE-----")){e.next=434;break}return e.abrupt("return",{ext:"pgp",mime:"application/pgp-encrypted"});case 434:if(!(n.length>=2&&r([255,224],{offset:0,mask:[255,224]}))){e.next=445;break}if(!r([16],{offset:1,mask:[22]})){e.next=439;break}if(!r([8],{offset:1,mask:[8]})){e.next=438;break}return e.abrupt("return",{ext:"aac",mime:"audio/aac"});case 438:return e.abrupt("return",{ext:"aac",mime:"audio/aac"});case 439:if(!r([2],{offset:1,mask:[6]})){e.next=441;break}return e.abrupt("return",{ext:"mp3",mime:"audio/mpeg"});case 441:if(!r([4],{offset:1,mask:[6]})){e.next=443;break}return e.abrupt("return",{ext:"mp2",mime:"audio/mpeg"});case 443:if(!r([6],{offset:1,mask:[6]})){e.next=445;break}return e.abrupt("return",{ext:"mp1",mime:"audio/mpeg"});case 445:case"end":return e.stop()}}),e,null,[[61,116],[399,406]])})))).apply(this,arguments)}var stream=function stream(readableStream){return new Promise((function(resolve,reject){var stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,n,r,i;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new stream.PassThrough,n=stream.pipeline?stream.pipeline(readableStream,t,(function(){})):readableStream.pipe(t),r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0),e.prev=3,e.next=6,fromBuffer(r);case 6:i=e.sent,t.fileType=i,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),reject(e.t0);case 13:resolve(n);case 14:case"end":return e.stop()}}),e,null,[[3,10]])}))))}))},fileType={fromStream:fromStream,fromTokenizer:fromTokenizer,fromBuffer:fromBuffer,stream:stream};Object.defineProperty(fileType,"extensions",{get:function(){return new Set(supported.extensions)}}),Object.defineProperty(fileType,"mimeTypes",{get:function(){return new Set(supported.mimeTypes)}}),module.exports=fileType}).call(this,__webpack_require__(19).Buffer)},function(e,t,n){(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n>8,!0),t+3}},t.UINT24_BE={len:3,get:function(e,t){var n=c(e);return(n.getUint16(t)<<8)+n.getUint8(t+2)},put:function(e,t,n){var r=c(e);return r.setUint16(t,n>>8),r.setUint8(t+2,255&n),t+3}},t.UINT32_LE={len:4,get:function(e,t){return c(e).getUint32(t,!0)},put:function(e,t,n){return c(e).setUint32(t,n,!0),t+4}},t.UINT32_BE={len:4,get:function(e,t){return c(e).getUint32(t)},put:function(e,t,n){return c(e).setUint32(t,n),t+4}},t.INT8={len:1,get:function(e,t){return c(e).getInt8(t)},put:function(e,t,n){return c(e).setInt8(t,n),t+1}},t.INT16_BE={len:2,get:function(e,t){return c(e).getInt16(t)},put:function(e,t,n){return c(e).setInt16(t,n),t+2}},t.INT16_LE={len:2,get:function(e,t){return c(e).getInt16(t,!0)},put:function(e,t,n){return c(e).setInt16(t,n,!0),t+2}},t.INT24_LE={len:3,get:function(e,n){var r=t.UINT24_LE.get(e,n);return r>8388607?r-16777216:r},put:function(e,t,n){var r=c(e);return r.setUint8(t,255&n),r.setUint16(t+1,n>>8,!0),t+3}},t.INT24_BE={len:3,get:function(e,n){var r=t.UINT24_BE.get(e,n);return r>8388607?r-16777216:r},put:function(e,t,n){var r=c(e);return r.setUint16(t,n>>8),r.setUint8(t+2,255&n),t+3}},t.INT32_BE={len:4,get:function(e,t){return c(e).getInt32(t)},put:function(e,t,n){return c(e).setInt32(t,n),t+4}},t.INT32_LE={len:4,get:function(e,t){return c(e).getInt32(t,!0)},put:function(e,t,n){return c(e).setInt32(t,n,!0),t+4}},t.UINT64_LE={len:8,get:function(e,t){return c(e).getBigUint64(t,!0)},put:function(e,t,n){return c(e).setBigUint64(t,n,!0),t+8}},t.INT64_LE={len:8,get:function(e,t){return c(e).getBigInt64(t,!0)},put:function(e,t,n){return c(e).setBigInt64(t,n,!0),t+8}},t.UINT64_BE={len:8,get:function(e,t){return c(e).getBigUint64(t)},put:function(e,t,n){return c(e).setBigUint64(t,n),t+8}},t.INT64_BE={len:8,get:function(e,t){return c(e).getBigInt64(t)},put:function(e,t,n){return c(e).setBigInt64(t,n),t+8}},t.Float16_BE={len:2,get:function(e,t){return u.read(e,t,!1,10,this.len)},put:function(e,t,n){return u.write(e,n,t,!1,10,this.len),t+this.len}},t.Float16_LE={len:2,get:function(e,t){return u.read(e,t,!0,10,this.len)},put:function(e,t,n){return u.write(e,n,t,!0,10,this.len),t+this.len}},t.Float32_BE={len:4,get:function(e,t){return c(e).getFloat32(t)},put:function(e,t,n){return c(e).setFloat32(t,n),t+4}},t.Float32_LE={len:4,get:function(e,t){return c(e).getFloat32(t,!0)},put:function(e,t,n){return c(e).setFloat32(t,n,!0),t+4}},t.Float64_BE={len:8,get:function(e,t){return c(e).getFloat64(t)},put:function(e,t,n){return c(e).setFloat64(t,n),t+8}},t.Float64_LE={len:8,get:function(e,t){return c(e).getFloat64(t,!0)},put:function(e,t,n){return c(e).setFloat64(t,n,!0),t+8}},t.Float80_BE={len:10,get:function(e,t){return u.read(e,t,!1,63,this.len)},put:function(e,t,n){return u.write(e,n,t,!1,63,this.len),t+this.len}},t.Float80_LE={len:10,get:function(e,t){return u.read(e,t,!0,63,this.len)},put:function(e,t,n){return u.write(e,n,t,!0,63,this.len),t+this.len}};var l=function(){function e(t){i(this,e),this.len=t}return a(e,[{key:"get",value:function(e,t){}}]),e}();t.IgnoreType=l;var f=function(){function e(t){i(this,e),this.len=t}return a(e,[{key:"get",value:function(e,t){return e.subarray(t,t+this.len)}}]),e}();t.Uint8ArrayType=f;var h=function(){function t(e){i(this,t),this.len=e}return a(t,[{key:"get",value:function(t,n){return e.from(t.subarray(n,n+this.len))}}]),t}();t.BufferType=h;var p=function(){function t(e,n){i(this,t),this.len=e,this.encoding=n}return a(t,[{key:"get",value:function(t,n){return e.from(t).toString(this.encoding,n,n+this.len)}}]),t}();t.StringType=p;var d=function(){function e(t){i(this,e),this.len=t}return a(e,[{key:"get",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.decode(t,n,n+this.len)}}],[{key:"decode",value:function(t,n,r){for(var i="",o=n;o>10),56320+(1023&e)))}},{key:"singleByteDecoder",value:function(t){if(e.inRange(t,0,127))return t;var n=e.windows1252[t-128];if(null===n)throw Error("invaliding encoding");return n}}]),e}();t.AnsiStringType=d,d.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}).call(this,n(19).Buffer)},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,c-=8);e[n+p-d]|=128*m}},function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:0,n=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(n))return!1;for(var r=256,i=t;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var u=n(e);if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*a;case"hours":case"hour":case"hrs":case"hr":case"h":return n*o;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=a?s(e,t,a,"day"):t>=o?s(e,t,o,"hour"):t>=i?s(e,t,i,"minute"):t>=r?s(e,t,r,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+"d":t>=o?Math.round(e/o)+"h":t>=i?Math.round(e/i)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){n.r(t),n.d(t,"XhrAdapter",(function(){return f}));var r=n(0),i=n(3),o=n.n(i),a=n(4),s=n(5),u=n(2),c=n(9),l=o()("fs:request:xhr"),f=function(){function e(){}return e.prototype.request=function(e){var t=this;void 0===e.filestackHeaders&&(e.filestackHeaders=!0),(e=Object(c.d)(e)).headers=e.headers||{};var n=e.data,i=e.headers;a.e(n)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.blobResponse&&(o.responseType="blob"),e.auth){if(!e.auth.username||0===e.auth.username.length||!e.auth.password||0===e.auth.password.length)return Promise.reject(new u.a("Basic auth: username and password are required ".concat(e.auth),e));i.Authorization="Basic "+btoa(unescape(encodeURIComponent("".concat(e.auth.username,":").concat(e.auth.password)))),l("Set request authorization to %s",e.auth.username+e.auth.password)}var f=e.url.trim();return/^http(s)?:\/\//.test(f)||(f="https://".concat(f)),f=Object(c.a)(f,e.params),l("Starting request to %s with options %O",f,e),o.open(e.method.toUpperCase(),f,!0),o.timeout=e.timeout,new Promise((function(a,h){var p;if(e.cancelToken&&(p=function(t){return o&&(o.abort(),o=null),l("Request canceled by user %s, config: %O",t,e),h(new u.a("Request aborted. Reason: ".concat(t),e,null,u.b.ABORTED))},e.cancelToken.once("cancel",p)),o.onreadystatechange=function(){return Object(r.b)(t,void 0,void 0,(function(){var t,n,i;return Object(r.d)(this,(function(r){switch(r.label){case 0:return o&&4===o.readyState&&(0!==o.status||o.responseURL)?(t=Object(c.b)(o.getAllResponseHeaders()),n=o.response,i={data:n,status:o.status,statusText:o.statusText,headers:t,config:e},o=null,[4,Object(c.c)(i)]):[2];case 1:return 500<=(i=r.sent()).status&&i.status<=599?(l("Server error(5xx) - %O",i),[2,h(new u.a("Server error ".concat(f),e,i,u.b.SERVER))]):400<=i.status&&i.status<=499?(l("Request error(4xx) - %O",i),[2,h(new u.a("Request error ".concat(f),e,i,u.b.REQUEST))]):(e.cancelToken&&(e.cancelToken.removeListener("cancel",p),p=null),[2,a(i)])}}))}))},o.onabort=function(){o&&(o=null,h(new u.a("Request aborted",e,null,u.b.ABORTED)))},o.onerror=function(t){o=null,l("Request error! %O",t),h(new u.a("Network Error",e,null,u.b.NETWORK))},o.ontimeout=function(){o=null,l("Request timed out. %O",e),h(new u.a("Request timeout",e,null,u.b.TIMEOUT))},"setRequestHeader"in o&&i&&Object.keys(i).length)for(var d in i)void 0!==i[d]&&(l("Set request header %s to %s",d,i[d]),o.setRequestHeader(d,i[d]));"function"==typeof e.onProgress&&[s.a.POST,s.a.PUT].indexOf(e.method)>-1&&(o.upload?(l("Bind to upload progress event"),o.upload.addEventListener("progress",e.onProgress)):(l("Bind to progress event"),o.addEventListener("progress",e.onProgress))),void 0===n&&(n=null),o.send(n)}))},e}()},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(e,t){return String.fromCharCode(Number.parseInt(t,10))}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(e,t){return String.fromCharCode(Number.parseInt(t,16))}}},this.addExternalEntities=h,this.parseXml=g,this.parseTextData=p,this.resolveNameSpace=d,this.buildAttributesMap=v,this.isItStopNode=w,this.replaceEntitiesValue=b,this.readStopNodeData=_,this.saveTextToParentTag=O,this.addChild=y}));function h(e){for(var t=Object.keys(e),n=0;n0)){s||(e=this.replaceEntitiesValue(e));var u=this.options.tagValueProcessor(t,e,n,o,a);return null==u?e:i(u)!==i(e)||u!==e?u:this.options.trimValues||e.trim()===e?P(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function d(e){if(this.options.removeNSPrefix){var t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}var m=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function v(e,t,n){if(!this.options.ignoreAttributes&&"string"==typeof e){for(var r=s.getAllMatches(e,m),o=r.length,a={},u=0;u",a,"Closing Tag is not closed."),l=e.substring(a+2,s).trim();if(this.options.removeNSPrefix){var f=l.indexOf(":");-1!==f&&(l=l.substr(f+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&(i=this.saveTextToParentTag(i,n,o));var h=o.substring(o.lastIndexOf(".")+1);if(l&&-1!==this.options.unpairedTags.indexOf(l))throw new Error("Unpaired tag can not be used as closing tag: "));var p=0;h&&-1!==this.options.unpairedTags.indexOf(h)?(p=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):p=o.lastIndexOf("."),o=o.substring(0,p),n=this.tagsNodeStack.pop(),i="",a=s}else if("?"===e[a+1]){var d=S(e,a,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,o),this.options.ignoreDeclaration&&"?xml"===d.tagName||this.options.ignorePiTags);else{var m=new u(d.tagName);m.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(m[":@"]=this.buildAttributesMap(d.tagExp,o,d.tagName)),this.addChild(n,m,o)}a=d.closeIndex+1}else if("!--"===e.substr(a+1,3)){var v=k(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var g=e.substring(a+4,v-2);i=this.saveTextToParentTag(i,n,o),n.add(this.options.commentPropName,[r({},this.options.textNodeName,g)])}a=v}else if("!D"===e.substr(a+1,2)){var y=c(e,a);this.docTypeEntities=y.entities,a=y.i}else if("!["===e.substr(a+1,2)){var b=k(e,"]]>",a,"CDATA is not closed.")-2,O=e.substring(a+9,b);i=this.saveTextToParentTag(i,n,o);var w=this.parseTextData(O,n.tagname,o,!0,!1,!0,!0);null==w&&(w=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[r({},this.options.textNodeName,O)]):n.add(this.options.textNodeName,w),a=b+2}else{var x=S(e,a,this.options.removeNSPrefix),_=x.tagName,P=x.rawTagName,E=x.tagExp,T=x.attrExpPresent,j=x.closeIndex;this.options.transformTagName&&(_=this.options.transformTagName(_)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,o,!1));var C=n;if(C&&-1!==this.options.unpairedTags.indexOf(C.tagname)&&(n=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),_!==t.tagname&&(o+=o?"."+_:_),this.isItStopNode(this.options.stopNodes,o,_)){var A="";if(E.length>0&&E.lastIndexOf("/")===E.length-1)"/"===_[_.length-1]?(_=_.substr(0,_.length-1),o=o.substr(0,o.length-1),E=_):E=E.substr(0,E.length-1),a=x.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(_))a=x.closeIndex;else{var R=this.readStopNodeData(e,P,j+1);if(!R)throw new Error("Unexpected end of ".concat(P));a=R.i,A=R.tagContent}var $=new u(_);_!==E&&T&&($[":@"]=this.buildAttributesMap(E,o,_)),A&&(A=this.parseTextData(A,_,o,!0,T,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),$.add(this.options.textNodeName,A),this.addChild(n,$,o)}else{if(E.length>0&&E.lastIndexOf("/")===E.length-1){"/"===_[_.length-1]?(_=_.substr(0,_.length-1),o=o.substr(0,o.length-1),E=_):E=E.substr(0,E.length-1),this.options.transformTagName&&(_=this.options.transformTagName(_));var Q=new u(_);_!==E&&T&&(Q[":@"]=this.buildAttributesMap(E,o,_)),this.addChild(n,Q,o),o=o.substr(0,o.lastIndexOf("."))}else{var I=new u(_);this.tagsNodeStack.push(n),_!==E&&T&&(I[":@"]=this.buildAttributesMap(E,o,_)),this.addChild(n,I,o),n=I}i="",a=j}}else i+=e[a];return t.child};function y(e,t,n){var r=this.options.updateTag(t.tagname,n,t[":@"]);!1===r||("string"==typeof r?(t.tagname=r,e.addChild(t)):e.addChild(t))}var b=function(e){if(this.options.processEntities){for(var t in this.docTypeEntities){var n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(var r in this.lastEntities){var i=this.lastEntities[r];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(var o in this.htmlEntities){var a=this.htmlEntities[o];e=e.replace(a.regex,a.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function O(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function w(e,t,n){var r="*."+n;for(var i in e){var o=e[i];if(r===o||t===o)return!0}return!1}function x(e,t){for(var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",i="",o=t;o3&&void 0!==arguments[3]?arguments[3]:">",i=x(e,t+1,r);if(i){var o=i.data,a=i.index,s=o.search(/\s/),u=o,c=!0;-1!==s&&(u=o.substring(0,s),o=o.substring(s+1).trimStart());var l=u;if(n){var f=u.indexOf(":");-1!==f&&(c=(u=u.substr(f+1))!==i.data.substr(f+1))}return{tagName:u,tagExp:o,closeIndex:a,attrExpPresent:c,rawTagName:l}}}function _(e,t,n){for(var r=n,i=1;n",n,"".concat(t," is not closed"));if(e.substring(n+2,o).trim()===t&&0==--i)return{tagContent:e.substring(r,n),i:o};n=o}else if("?"===e[n+1])n=k(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=k(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=k(e,"]]>",n,"StopNode is not closed.")-2;else{var a=S(e,n,">");a&&((a&&a.tagName)===t&&"/"!==a.tagExp[a.tagExp.length-1]&&i++,n=a.closeIndex)}}function P(e,t,n){if(t&&"string"==typeof e){var r=e.trim();return"true"===r||"false"!==r&&l(e,n)}return s.isExist(e)?e:""}e.exports=f},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.child.push(i(i({},e.tagname,e.child),":@",e[":@"])):this.child.push(i({},e.tagname,e.child))}}])&&o(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=s},function(e,t,n){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"===e[t]){if(p?"-"===e[t-1]&&"-"===e[t-2]&&(p=!1,i--):i--,0===i)break}else"["===e[t]?o=!0:e[t];else{if(o&&u(e,t)){var d=r(a(e,(t+=7)+1),3);entityName=d[0],val=d[1],t=d[2],-1===val.indexOf("&")&&(n[h(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(o&&c(e,t))t+=8;else if(o&&l(e,t))t+=8;else if(o&&f(e,t))t+=9;else{if(!s)throw new Error("Invalid DOCTYPE");p=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:n,i:t}}},function(e,t){var n=/^[-+]?0x[a-fA-F0-9]+$/,r=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function o(e){return e&&-1!==e.indexOf(".")?("."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e):e}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({},i,t),!e||"string"!=typeof e)return e;var a=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(a))return e;if(t.hex&&n.test(a))return Number.parseInt(a,16);var s=r.exec(a);if(s){var u=s[1],c=s[2],l=o(s[3]),f=s[4]||s[6];if(!t.leadingZeros&&c.length>0&&u&&"."!==a[2])return e;if(!t.leadingZeros&&c.length>0&&!u&&"."!==a[1])return e;var h=Number(a),p=""+h;return-1!==p.search(/[eE]/)||f?t.eNotation?h:e:-1!==a.indexOf(".")?"0"===p&&""===l||p===l||u&&p==="-"+l?h:e:c?l===p||u+l===p?h:e:a===p||a===u+p?h:e}return e}},function(e,t,n){function r(e){for(var t=Object.keys(e),n=0;n0&&(u[n.textNodeName]=s):void 0!==s&&(u[n.textNodeName]=s),u}(e,t)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(68),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function a(e){this.options=Object.assign({},o,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=s,this.options.format?(this.indentate=u,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function s(e,t,n){var r=this.j2x(e,n+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,r.attrStr,n):this.buildObjectNode(r.val,t,r.attrStr,n)}function u(e){return this.options.indentBy.repeat(e)}function c(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}a.prototype.build=function(e){return this.options.preserveOrder?i(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e=function(e,t,n){var i;return i=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==r(i)?i:String(i))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.options.arrayNodeName,e)),this.j2x(e,0).val)},a.prototype.j2x=function(e,t){var n="",i="";for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))if(void 0===e[o])this.isAttribute(o)&&(i+="");else if(null===e[o])this.isAttribute(o)?i+="":"?"===o[0]?i+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)i+=this.buildTextValNode(e[o],o,"",t);else if("object"!==r(e[o])){var a=this.isAttribute(o);if(a)n+=this.buildAttrPairStr(a,""+e[o]);else if(o===this.options.textNodeName){var s=this.options.tagValueProcessor(o,""+e[o]);i+=this.replaceEntitiesValue(s)}else i+=this.buildTextValNode(e[o],o,"",t)}else if(Array.isArray(e[o])){for(var u=e[o].length,c="",l="",f=0;f"+e+i},a.prototype.closeTag=function(e){var t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":">")+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+"\x3c!--".concat(e,"--\x3e")+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(t,e);return""===(i=this.replaceEntitiesValue(i))?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+i+"0&&this.options.processEntities)for(var t=0;t0&&t.processEntities)for(var n=0;n0&&(a="\n"),function e(t,a,s,u){for(var c="",l=!1,f=0;f":c+=g+"/>":y&&0!==y.length||!a.suppressEmptyNode?y&&y.endsWith(">")?c+=g+">".concat(y).concat(u,""):(c+=g+">",y&&""!==u&&(y.includes("/>")||y.includes("")):c+=g+"/>",l=!0}else{var b=r(h[":@"],a),O="?xml"===p?"":u,w=h[p][0][a.textNodeName];w=0!==w.length?" "+w:"",c+=O+"<".concat(p).concat(w).concat(b,"?>"),l=!0}else c+=u+"\x3c!--".concat(h[p][0][a.textNodeName],"--\x3e"),l=!0;else l&&(c+=u),c+=""),l=!1;else{var x=h[p];i(d,a)||(x=o(x=a.tagValueProcessor(p,x),a)),l&&(c+=u),c+=x,l=!1}}}return c}(e,t,"",a)}},function(e,t,n){var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},c.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r=t.priority)this._queue.push(n);else{var r=a.default(this._queue,n,(function(e,t){return t.priority-e.priority}));this._queue.splice(r,0,n)}}},{key:"dequeue",value:function(){var e=this._queue.shift();return null==e?void 0:e.run}},{key:"filter",value:function(e){return this._queue.filter((function(t){return t.priority===e.priority})).map((function(e){return e.run}))}},{key:"size",get:function(){return this._queue.length}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){for(var r=0,i=e.length;i>0;){var o=i/2|0,a=r+o;n(e[a],t)<=0?(r=++a,i-=o+1):i=o}return r}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t),n.d(t,"Filestack",(function(){return Mt})),n.d(t,"init",(function(){return Dt})),n.d(t,"version",(function(){return Nt})),n.d(t,"EAlignOptions",(function(){return Pe})),n.d(t,"EAlignFacesOptions",(function(){return Ee})),n.d(t,"EFitOptions",(function(){return Te})),n.d(t,"EBlurMode",(function(){return je})),n.d(t,"EShapeType",(function(){return Ce})),n.d(t,"ENoiseType",(function(){return Ae})),n.d(t,"EStyleType",(function(){return Re})),n.d(t,"EColorspaceType",(function(){return $e})),n.d(t,"ECropfacesType",(function(){return Qe})),n.d(t,"ESmartCropMode",(function(){return Ie})),n.d(t,"EImageWatermarkPosition",(function(){return Me})),n.d(t,"EAudioTypes",(function(){return De})),n.d(t,"EVideoTypes",(function(){return Ne})),n.d(t,"EUrlscreenshotAgent",(function(){return Fe})),n.d(t,"EUrlscreenshotMode",(function(){return Le})),n.d(t,"EUrlscreenshotOrientation",(function(){return qe})),n.d(t,"EVideoLocations",(function(){return ze})),n.d(t,"EVideoAccess",(function(){return Ue})),n.d(t,"EVideoAccessMode",(function(){return Be})),n.d(t,"transform",(function(){return ct})),n.d(t,"Align",(function(){return ae})),n.d(t,"FitOptions",(function(){return se})),n.d(t,"BlurMode",(function(){return ue})),n.d(t,"ShapeType",(function(){return ce})),n.d(t,"NoiseType",(function(){return le})),n.d(t,"StyleType",(function(){return fe})),n.d(t,"ColorspaceType",(function(){return he})),n.d(t,"CropfacesType",(function(){return pe})),n.d(t,"ImageWatermarkPosition",(function(){return de})),n.d(t,"SmartCropMode",(function(){return me})),n.d(t,"AudioTypes",(function(){return ve})),n.d(t,"VideoTypes",(function(){return ge})),n.d(t,"URLScreenshotAgent",(function(){return ye})),n.d(t,"URLScreenshotMode",(function(){return be})),n.d(t,"URLScreenshotOrientation",(function(){return Oe})),n.d(t,"Locations",(function(){return we})),n.d(t,"VideoAccess",(function(){return xe})),n.d(t,"VideoAccessMode",(function(){return ke})),n.d(t,"EnhancePreset",(function(){return Se})),n.d(t,"Filelink",(function(){return Ve})),n.d(t,"FilestackErrorType",(function(){return X})),n.d(t,"FsHttpMethod",(function(){return Je.a})),n.d(t,"FsRequest",(function(){return it})),n.d(t,"FsRequestErrorCode",(function(){return ot.b})),n.d(t,"FsRequestError",(function(){return ot.a})),n.d(t,"FsCancelToken",(function(){return at})),n.d(t,"resolveCdnUrl",(function(){return ne.resolveCdnUrl})),n.d(t,"resolveHost",(function(){return ne.resolveHost})),n.d(t,"removeEmpty",(function(){return ne.removeEmpty})),n.d(t,"uniqueTime",(function(){return ne.uniqueTime})),n.d(t,"uniqueId",(function(){return ne.uniqueId})),n.d(t,"extensionToMime",(function(){return ne.extensionToMime})),n.d(t,"sanitizeName",(function(){return ne.sanitizeName})),n.d(t,"filterObject",(function(){return ne.filterObject})),n.d(t,"cleanUpCallbacks",(function(){return ne.cleanUpCallbacks})),n.d(t,"md5",(function(){return ne.md5})),n.d(t,"b64",(function(){return ne.b64})),n.d(t,"getVersion",(function(){return ne.getVersion})),n.d(t,"isMobile",(function(){return ne.isMobile})),n.d(t,"isFacebook",(function(){return ne.isFacebook})),n.d(t,"TransformSchema",(function(){return H})),n.d(t,"getSecurity",(function(){return u})),n.d(t,"validateWebhookSignature",(function(){return c})),n.d(t,"Client",(function(){return It})),n.d(t,"FilestackError",(function(){return G})),n.d(t,"PickerDisplayMode",(function(){return Rt})),n.d(t,"getMimetype",(function(){return ne.getMimetype})),n.d(t,"PrefetchEvents",(function(){return Pt}));var i=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==r(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n.r(t),n.d(t,"loadModules",(function(){return u})),n.d(t,"loadModule",(function(){return c})),n.d(t,"registerModule",(function(){return l})),n.d(t,"loadCss",(function(){return f})),n.d(t,"FILESTACK_MODULES",(function(){return r}));var r,i={},o=function(){var e,t=(e="undefined"==typeof window?i:window).filestackInternals;return t||(t={modules:{}},e.filestackInternals=t),t.modules||(t.modules={}),t}(),a=o&&o.modules,s=function(e,t,n){e.detachEvent?e.detachEvent("onreadystatechange",t):e.removeEventListener(n,t,!1)},u=function(e){return Promise.all(e.map((function(e){var t=e.id,n=e.url;return c(t,n)}))).then((function(t){var n={};return t.forEach((function(t,r){var i=e[r];n[i.id]=t})),n}))},c=function(e,t){if("undefined"==typeof window)return Promise.reject(new Error("Load module is working only on browser env"));if(!e)throw new Error("Module id is required");var n=a[e="fs-loader-"+e];return n||(a[e]={},n=a[e]),n.instance?Promise.resolve(n.instance):n.promise?n.promise:n.promise=new Promise((function(n,r){var i=function t(i){if("load"===i.type||/^(complete|loaded)$/.test((i.currentTarget||i.srcElement).readyState)){var o=i.currentTarget||i.srcElement;s(o,t,"load"),s(o,r,"error"),setTimeout((function(){return n(a[e]?a[e].instance:void 0)}),10)}},o=document.createElement("script");o.id=e,!o.attachEvent||o.attachEvent.toString&&o.attachEvent.toString().indexOf("[native code")<0?(o.addEventListener("load",i,!1),o.addEventListener("onerror",r,!1)):o.attachEvent("onreadystatechange",i),o.setAttribute("crossorigin","anonymous"),o.setAttribute("charset","utf-8"),o.setAttribute("async","true"),o.src=t,document.body.appendChild(o)}))},l=function(e,t,n){if("undefined"!=typeof window){if(!e)throw new Error("Module id is required");if(!a)throw new Error("Loader is not initialized");a[e="fs-loader-"+e]&&(a[e]={instance:t,metadata:n})}},f=function(e){return null!==document.querySelector('link[href="'.concat(e,'"]'))?Promise.resolve():new Promise((function(t){var n=document.getElementsByTagName("head")[0],r=document.createElement("link");r.rel="stylesheet",r.href=e,r.addEventListener("load",(function e(){t(),r.removeEventListener("load",e)})),n.appendChild(r)}))};!function(e){e.FILESTACK_SDK="filestack-sdk",e.TRANSFORMS_UI="transforms-ui",e.PICKER="picker"}(r||(r={}))}]),o=(i.loadModules,i.loadModule),a=i.registerModule,s=(i.loadCss,i.FILESTACK_MODULES),u=function(e,t){throw new Error("getSecurity is only supported in nodejs")},c=function(e,t,n){throw new Error("validateWebhookSignature is only supported in nodejs")},l=n(0),f=n(7),h=n.n(f);function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function d(){for(var e=[],t=0;t0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var e=[],t=0;t0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function b(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;void 0!==e[a]&&(r[a]=S(e[a]))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}return Array.isArray(e)?e.map(S):e}function _(){var e=Object(O.a)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}var P,E=n(76),T="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,j=Object(O.a)(),C=["debug","info","warn","error","log","assert"];function A(e){var t=Object(O.a)();if(!("console"in t))return e();var n=t.console,r={};C.forEach((function(e){var i=n[e]&&n[e].__sentry_original__;e in t.console&&i&&(r[e]=n[e],n[e]=i)}));try{return e()}finally{Object.keys(r).forEach((function(e){n[e]=r[e]}))}}function R(){var e=!1,t={enable:function(){e=!0},disable:function(){e=!1}};return T?C.forEach((function(n){t[n]=function(){for(var t=[],r=0;r0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(g(Object(O.b)("globalEventProcessors",(function(){return[]})),this._eventProcessors),e,t)},e.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=m(m({},this._sdkProcessingMetadata),e),this},e.prototype._notifyEventProcessors=function(e,t,n,r){var i=this;return void 0===r&&(r=0),new I((function(o,a){var s=e[r];if(null===t||"function"!=typeof s)o(t);else{var u=s(m({},t),n);k(u)?u.then((function(t){return i._notifyEventProcessors(e,t,n,r+1).then(o)})).then(null,a):i._notifyEventProcessors(e,u,n,r+1).then(o).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();var D=function(){function e(e){this.errors=0,this.sid=_(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var t=Object(E.b)();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||Object(E.b)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:_()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):"ok"===this.status?this.update({status:"exited"}):this.update()},e.prototype.toJSON=function(){return S({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}(),N=function(){function e(e,t,n){void 0===t&&(t=new M),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version-1};var te=function(e){return function(t){return ee.addSchema(J),ee.validate(t,e)}},ne=n(1),re=n(3),ie=n.n(re);function oe(e){return(oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ae,se,ue,ce,le,fe,he,pe,de,me,ve,ge,ye,be,Oe,we,xe,ke,Se,_e=ie()("fs:filelink");!function(e){e.left="left",e.right="right",e.center="center",e.bottom="bottom",e.top="top",e.faces="faces",e.middle="middle"}(ae||(ae={})),function(e){e.clip="clip",e.crop="crop",e.scale="scale",e.max="max"}(se||(se={})),function(e){e.linear="linear",e.gaussian="gaussian"}(ue||(ue={})),function(e){e.oval="oval",e.rect="rect"}(ce||(ce={})),function(e){e.none="none",e.low="low",e.medium="medium",e.high="high"}(le||(le={})),function(e){e.artwork="artwork",e.photo="photo"}(fe||(fe={})),function(e){e.RGB="RGB",e.CMYK="CMYK",e.Input="Input"}(he||(he={})),function(e){e.thumb="thumb",e.crop="crop",e.fill="fill"}(pe||(pe={})),function(e){e.top="top",e.middle="middle",e.bottom="bottom",e.left="left",e.center="center",e.right="right"}(de||(de={})),function(e){e.face="face",e.auto="auto"}(me||(me={})),function(e){e.libmp3lame="libmp3lame",e.libvorbis="libvorbis",e.libfdk_aac="libfdk_aac",e.dib_ac3="dib_ac3",e.pcm_s16le="pcm_s16le",e.mp2="mp2",e.ac3="ac3",e.eac3="eac3"}(ve||(ve={})),function(e){e.h264="h264",e.h264_hi="h264.hi",e.webm="webm",e["webm-hi"]="webm.hi",e.ogg="ogg",e["ogg-hi"]="ogg.hi",e["hls-variant"]="hls.variant",e.mp3="mp3",e.oga="oga",e.m4a="m4a",e.aac="aac",e.hls="hls.variant.audio"}(ge||(ge={})),function(e){e.desktop="desktop",e.mobile="mobile"}(ye||(ye={})),function(e){e.all="all",e.window="window"}(be||(be={})),function(e){e.portrait="portrait",e.landscape="landscape"}(Oe||(Oe={})),function(e){e.s3="s3",e.azure="azure",e.gcs="gcs",e.rackspace="rackspace",e.dropbox="dropbox"}(we||(we={})),function(e){e.private="private",e.public="public"}(xe||(xe={})),function(e){e.preserve="preserve",e.constrain="constrain",e.letterbox="letterbox",e.pad="pad",e.crop="crop"}(ke||(ke={})),function(e){e.auto="auto",e.vivid="vivid",e.beautify="beautify",e.beautifyPlus="beautify_plus",e.fixDark="fix_dark",e.fixNoise="fix_noise",e.fixTint="fix_tint",e.outdor="outdoor",e.fireworks="fireworks"}(Se||(Se={}));var Pe,Ee,Te,je,Ce,Ae,Re,$e,Qe,Ie,Me,De,Ne,Fe,Le,qe,ze,Ue,Be,Ze=/^[\w\-]{20}|wf:\/\/[\w\-\/]{106}$/,Ve=function(){function e(e,t){this.transforms=[],this.b64=!1,this.useValidator=!0,this.arrayToObject=function(e,t,n){return void 0===e&&(e=[]),e.reduce((function(e,r){return e[r[t]]=r[n],e}),{})},this.apikey=t,this.setSource(e)}return e.prototype.setBase64=function(e){return this.b64=e,this},e.prototype.setUseValidator=function(e){return this.useValidator=e,this},e.prototype.setCname=function(e){return this.cname=e,this},e.prototype.setCustomDomain=function(e){return this.customDomain=e,this},e.prototype.setSource=function(e){this.source=e;var t=this.isSourceExternal();if(_e("Source ".concat(e," - isExternal? ").concat(t)),t&&!this.apikey)throw new G("External sources requires apikey to handle transforms");if(!t&&"string"==typeof this.source&&!Ze.test(this.source)&&-1===this.source.indexOf("filestackcontent"))throw new G("Invalid filestack source provided")},e.prototype.getValidationSchema=function(){return H},e.prototype.getTransformations=function(){return this.useValidator&&this.validateTasks(this.transforms),this.transforms},e.prototype.toString=function(){var e=[];e.push(this.getCdnHost()),this.useValidator&&this.validateTasks(this.transforms),this.apikey&&e.push(this.apikey);var t=this.generateTransformString(),n=this.source;return this.b64?(this.transforms.length>0&&(t="b64/".concat(Object(ne.b64)(JSON.stringify(this.transforms),!0))),Array.isArray(n)&&(n=this.arrayToString(n)),n="b64://".concat(Object(ne.b64)(n,!0))):n=Array.isArray(n)?this.arrayToString(n):this.escapeValue(n),t.length&&e.push(t),e.push(n),e.join("/")},e.prototype.addTask=function(e,t){if(ie()("Add task ".concat(e," with params %O"),t),"cache"!==e&&"boolean"==typeof t){if(!t)return this;t=void 0}else"object"!==oe(t)||Object.keys(t).length||(t=void 0);return this.transforms.push({name:e,params:t}),this},e.prototype.getTasks=function(){return this.transforms},e.prototype.reset=function(){return this.transforms=[],this},e.prototype.autoImage=function(){return this.addTask("auto_image",!0)},e.prototype.flip=function(){return this.addTask("flip",!0)},e.prototype.flop=function(){return this.addTask("flop",!0)},e.prototype.imagesize=function(){return this.addTask("imagesize",!0)},e.prototype.noMetadata=function(){return this.addTask("no_metadata",!0)},e.prototype.pjpg=function(e){return this.addTask("pjpg",e)},e.prototype.smartCrop=function(e){return this.addTask("smart_crop",e)},e.prototype.watermark=function(e){return this.addTask("watermark",e)},e.prototype.enhance=function(e){return this.addTask("enhance",e||!0)},e.prototype.redeye=function(){return this.addTask("redeye",!0)},e.prototype.monochrome=function(){return this.addTask("monochrome",!0)},e.prototype.compress=function(e){return this.addTask("compress",e||!0)},e.prototype.negative=function(){return this.addTask("negative",!0)},e.prototype.tags=function(){return this.addTask("tags",!0)},e.prototype.sfw=function(){return this.addTask("sfw",!0)},e.prototype.animate=function(e){return this.addTask("animate",e)},e.prototype.store=function(e){return this.addTask("store",e)},e.prototype.cache=function(e){return this.addTask("cache",e)},e.prototype.resize=function(e){return this.addTask("resize",e)},e.prototype.crop=function(e){return this.addTask("crop",e)},e.prototype.rotate=function(e){return this.addTask("rotate",e)},e.prototype.detectFaces=function(e){return this.addTask("detect_faces",e)},e.prototype.cropFaces=function(e){return this.addTask("crop_faces",e)},e.prototype.pixelateFaces=function(e){return this.addTask("pixelate_faces",e)},e.prototype.blurFaces=function(e){return this.addTask("blur_faces",e)},e.prototype.roundedCorners=function(e){return this.addTask("rounded_corners",e)},e.prototype.polaroid=function(e){return this.addTask("polaroid",e)},e.prototype.vignette=function(e){return this.addTask("vignette",e)},e.prototype.tornEdges=function(e){return this.addTask("torn_edges",e)},e.prototype.shadow=function(e){return this.addTask("shadow",e)},e.prototype.circle=function(e){return this.addTask("circle",e)},e.prototype.border=function(e){return this.addTask("border",e)},e.prototype.sharpen=function(e){return this.addTask("sharpen",e)},e.prototype.blur=function(e){return this.addTask("blur",e)},e.prototype.blackwhite=function(e){return this.addTask("blackwhite",e)},e.prototype.sepia=function(e){return this.addTask("sepia",e)},e.prototype.pixelate=function(e){return this.addTask("pixelate",e)},e.prototype.oilPaint=function(e){return this.addTask("oil_paint",e)},e.prototype.modulate=function(e){return this.addTask("modulate",e)},e.prototype.partialPixelate=function(e){return this.addTask("partial_pixelate",e)},e.prototype.partialBlur=function(e){return this.addTask("partial_blur",e)},e.prototype.collage=function(e){return this.addTask("collage",e)},e.prototype.upscale=function(e){return this.addTask("upscale",e)},e.prototype.ascii=function(e){return this.addTask("ascii",e)},e.prototype.quality=function(e){return this.addTask("quality",e)},e.prototype.security=function(e){return this.addTask("security",e)},e.prototype.output=function(e){return this.addTask("output",e)},e.prototype.videoConvert=function(e){return this.addTask("video_convert",e)},e.prototype.URLScreenshot=function(e){return this.addTask("urlscreenshot",e)},e.prototype.PDFInfo=function(e){return this.addTask("pdfinfo",e)},e.prototype.PDFConvert=function(e){return this.addTask("pdfconvert",e)},e.prototype.fallback=function(e){return this.addTask("fallback",e)},e.prototype.zip=function(){return this.addTask("zip",!0)},e.prototype.minifyCss=function(e){return this.addTask("minify_css",e)},e.prototype.minifyJs=function(e){return this.addTask("minify_js",e)},e.prototype.isSourceExternal=function(){if(!this.source)throw new G("Source not Set");var e=Array.isArray(this.source)?this.source:[this.source];for(var t in e)if(e.hasOwnProperty(t)&&(0===e[t].indexOf("src:")||0===e[t].indexOf("http")&&-1===e[t].indexOf("filestackcontent")))return!0;return!1},e.prototype.validateTasks=function(t){var n=e.validator(this.arrayToObject(t,"name","params"));if(n.errors.length)throw new G("Params validation error",n.errors,X.VALIDATION)},e.prototype.getCdnHost=function(){var e=Object.assign({},Y.urls);return this.customDomain&&(e.cdnUrl=this.customDomain),(e=Object(ne.resolveHost)(e,this.cname)).cdnUrl},e.prototype.generateTransformString=function(){var e=this,t=[];return this.transforms.forEach((function(n){t.push(e.optionToString(n.name,n.params))})),t.join("/")},e.prototype.optionToString=function(e,t){var n=this,r=[];return void 0===t?e:"boolean"==typeof t?t||"cache"!==e?e:"cache=false":(Object.keys(t).forEach((function(e){Array.isArray(t[e])?r.push("".concat(e,":").concat(n.arrayToString(t[e]))):r.push("".concat(e,":").concat(n.escapeValue(t[e])))})),"".concat(e,"=").concat(r.join(",")))},e.prototype.escapeValue=function(e){return"string"!=typeof e?e:e.indexOf("/")>-1||e.indexOf(",")>-1?'"'.concat(e,'"'):e},e.prototype.arrayToString=function(e){var t=this,n=e.map((function(e){return Array.isArray(e)?t.arrayToString(e):t.escapeValue(e)}));return"[".concat(n,"]")},e.validator=te(H),e}(),We={$schema:"http://json-schema.org/draft-07/schema#",title:"Filestack Store",description:"Filestack Store Options",type:"object",additionalProperties:!1,properties:{filename:{oneOf:[{type:"string"},{format:"callback"}]},location:{$ref:"locationsDef"},path:{type:"string"},container:{type:"string"},region:{$ref:"regionsDef"},access:{type:"string",enum:["public","private"],default:"private"},base64decode:{type:"boolean"},workflows:{$ref:"workflowsDef"},disableStorageKey:{type:"boolean"},tags:{type:"object",additionalProperties:{type:"string"}},sanitizer:{oneOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{exclude:{type:"array",items:[{type:"string"}]},replacement:{type:"string"}}}]}}},Xe={$schema:"http://json-schema.org/draft-07/schema#",title:"Filestack Preview",description:"Filestack Preview Options",type:"object",additionalProperties:!1,properties:{id:{type:"string"},css:{type:"string"}}},Ye={$schema:"http://json-schema.org/draft-07/schema#",title:"Filestack Upload",description:"Filestack Upload Options",type:"object",additionalProperties:!1,properties:{partSize:{type:"integer",minimum:5242880},concurrency:{type:"integer",minimum:1,maximum:20},progressInterval:{type:"integer",minimum:1},retry:{type:"integer",minimum:0,maximum:20},retryFactor:{type:"integer"},retryMaxTime:{type:"integer"},timeout:{type:"integer",minimum:1,maximum:36e5},intelligent:{oneOf:[{type:"boolean"},{type:"string",enum:["fallback"]}]},intelligentChunkSize:{type:"integer"},onProgress:{format:"callback"},onRetry:{format:"callback"},disableIntegrityCheck:{type:"boolean"},tags:{type:"object",maxItems:10,additionalProperties:{type:"string",maxlength:256}},altText:{type:["string","null"],maxLength:60}}},Ge={$schema:"http://json-schema.org/draft-07/schema#",title:"Filestack Picker",description:"Filestack Picker Options",type:"object",additionalProperties:!1,properties:{allowManualRetry:{type:"boolean"},accept:{additionalProperties:!1,oneOf:[{type:"string"},{type:"array",minItems:1,items:[{type:"string"}]}]},acceptFn:{format:"callback"},websearch:{type:"object",properties:{predefinedText:{type:"string"}}},fromSources:{type:"array",items:{anyOf:[{type:"string",enum:["local_file_system","url","imagesearch","facebook","instagram","googledrive","picasa","unsplash","dropbox","webcam","video","audio","box","github","gmail","googlephotos","onedrive","onedriveforbusiness","clouddrive","customsource","tint"]},{type:"object"}]}},container:{format:"HTMLContainer"},cleanupImageExif:{oneOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{keepOrientation:{type:"boolean"},keepICCandAPP:{type:"boolean"}}}]},displayMode:{type:"string",enum:["inline","overlay","dropPane"]},concurrency:{type:"integer",minimum:1,maximum:20},supportEmail:{type:"string"},customSourceContainer:{type:"string"},customSourcePath:{type:"string"},customSourceName:{type:"string"},disableStorageKey:{type:"boolean"},disableTransformer:{type:"boolean"},disableAltText:{type:"boolean"},disableThumbnails:{type:"boolean"},exposeOriginalFile:{type:"boolean"},globalDropZone:{type:"boolean"},hideModalWhenUploading:{type:"boolean"},imageDim:{type:"array",minItems:2,maxItems:2,items:[{type:"integer",minimum:1}]},imageMax:{type:"array",minItems:2,maxItems:2,items:[{type:"integer",minimum:1}]},imageMin:{type:"array",minItems:2,maxItems:2,items:[{type:"integer",minimum:1}]},imageMinMaxBlock:{type:"boolean",default:!1},lang:{type:"string",enum:["ca","da","de","en","es","fr","he","it","ja","ko","nl","no","pl","pt","sv","ru","vi","zh","tr","ar"]},minFiles:{type:"integer",minimum:1,maximum:1e6},maxFiles:{type:"integer",minimum:1,maximum:1e6},maxSize:{type:"integer",minimum:1},modalSize:{type:"array",minItems:2,maxItems:2,items:[{type:"integer",minimum:1,maximum:1e6}]},rootId:{type:"string"},startUploadingWhenMaxFilesReached:{type:"boolean"},uploadInBackground:{type:"boolean"},videoResolution:{type:"string"},onCancel:{format:"callback"},onClose:{format:"callback"},onOpen:{format:"callback"},onFileSelected:{format:"callback"},onFileUploadCancel:{format:"callback"},onFileUploadStarted:{format:"callback"},onFileUploadFinished:{format:"callback"},onFileUploadFailed:{format:"callback"},onFileUploadProgress:{format:"callback"},onUploadStarted:{format:"callback"},onUploadDone:{format:"callback"},onFileCropped:{format:"callback"},storeTo:{additionalProperties:!1,type:"object",properties:{filename:{type:"string"},location:{$ref:"locationsDef"},container:{type:"string"},path:{type:"string"},region:{type:"string"},access:{type:"string",enum:["public","private"]},workflows:{$ref:"workflowsDef"}}},viewType:{type:"string",enum:["grid","list"]},transformations:{type:"object",additionalProperties:!1,properties:{config:{type:"object"},circle:{type:"boolean"},rotate:{type:"boolean"},force:{type:"boolean"},crop:{oneOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{force:{type:"boolean"},aspectRatio:{type:"number"}}}]}}},customText:{type:"object",patternProperties:{".*":{type:"string"}}},cropFiles:{type:"array",minItems:1},loadCss:{type:"string"},failOverMaxFiles:{type:"boolean"},dropPane:{type:"object",properties:{cropFiles:{type:"array",minItems:1},customText:{type:"string"},disableClick:{type:"boolean"},overlay:{type:"boolean"},showIcon:{type:"boolean"},showProgress:{type:"boolean"},onDragEnter:{format:"callback"},onProgress:{format:"callback"},onDragLeave:{format:"callback"},onDragOver:{format:"callback"},onDrop:{format:"callback"},onSuccess:{format:"callback"},onError:{format:"callback"},onClick:{format:"callback"}}},errorsTimeout:{type:"number",minimum:0},customAuthText:{type:"object",patternProperties:{".*":{additionalProperties:!1,type:"object",required:["top","bottom"],properties:{top:{type:"string"},bottom:{type:"string"}}}}},uploadConfig:{type:"object",additionalProperties:!1,properties:Object(l.a)(Object(l.a)({},Ye.properties),{tags:{type:"object",additionalProperties:{anyOf:[{type:"string"},{format:"callback"}]}}})},useSentryBreadcrumbs:{type:"boolean"},transformationsUI:{type:"boolean"},pasteMode:{type:"object",additionalProperties:!1,properties:{pasteToFirstInViewPort:{type:"boolean"},pasteToFirstInstance:{type:"boolean"}}}}},He={$schema:"http://json-schema.org/draft-07/schema#",title:"Filestack Metadata",description:"Filestack Metadata Options",type:"object",additionalProperties:!1,properties:{size:{type:"boolean"},mimetype:{type:"boolean"},filename:{type:"boolean"},width:{type:"boolean"},metadata:{type:"boolean"},height:{type:"boolean"},uploaded:{type:"boolean"},writeable:{type:"boolean"},cloud:{type:"boolean"},sourceUrl:{type:"boolean"},md5:{type:"boolean"},sha1:{type:"boolean"},sha224:{type:"boolean"},sha256:{type:"boolean"},sha384:{type:"boolean"},sha512:{type:"boolean"},location:{type:"boolean"},path:{type:"boolean"},container:{type:"boolean"},exif:{type:"boolean"}}},Ke={$schema:"http://json-schema.org/draft-07/schema#",title:"Filestack Retrieve",description:"Filestack Retrieve Options",type:"object",additionalProperties:!1,properties:{metadata:{type:"boolean"},head:{type:"boolean"},dl:{type:"boolean"},cache:{type:"boolean"},extension:{type:"string"}}},Je=n(5),et=n(13),tt=ie()("fs:request:dispatch"),nt=function(){function e(e){this.adapter=e}return e.prototype.request=function(e){var t=this;return e.headers=e.headers||{},tt("Dispatching request %O",e),this.adapter.request(e).catch((function(e){return tt('Request error "%s": %O',e,e.response),t.retry(e)}))},e.prototype.retry=function(e){var t=this,n=e.config;if(!Object(et.a)(e))return tt("[Retry] Request error is not retriable. Exiting"),Promise.reject(e);if(!n.retry)return tt("[Retry] Retry config not found. Exiting"),Promise.reject(e);var r=n.retry,i=n.runtime&&n.runtime.retryCount?n.runtime.retryCount:0;if(r.retry&&r.retry<=i)return tt("[Retry] Retry attempts reached %d. Exiting",i),Promise.reject(e);var o=Math.max(Math.min(r.retryMaxTime,1e3*Math.pow(r.retryFactor,i)),1);return n.runtime=Object(l.a)(Object(l.a)({},n.runtime),{retryCount:i+1}),tt("[Retry] Retrying request to ".concat(n.url,", count ").concat(i," of ").concat(r.retry," - Delay: ").concat(o)),new Promise((function(e){setTimeout((function(){return e(t.request(n))}),o)}))},e}(),rt=n(59).XhrAdapter,it=function(){function e(e){this.defaults=e,this.dispatcher=new nt(new rt)}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.dispatch=function(e){return e.method||(e.method=Je.a.GET),this.dispatcher.request(Object.assign({},this.defaults,e))},e.dispatch=function(t,n){return e.getInstance().dispatch(Object.assign({},n||{},{url:t}))},e.get=function(t,n){return e.getInstance().dispatch(Object.assign({},n||{},{method:Je.a.GET,url:t}))},e.head=function(t,n){return e.getInstance().dispatch(Object.assign({},n||{},{method:Je.a.HEAD,url:t}))},e.options=function(t,n){return e.getInstance().dispatch(Object.assign({},n||{},{method:Je.a.OPTIONS,url:t}))},e.purge=function(t,n){return e.getInstance().dispatch(Object.assign({},n||{},{method:Je.a.PURGE,url:t}))},e.delete=function(t,n){return e.getInstance().dispatch(Object.assign({},n||{},{method:Je.a.DELETE,url:t}))},e.post=function(t,n,r){return e.getInstance().dispatch(Object.assign({},r||{},{method:Je.a.POST,url:t,data:n}))},e.put=function(t,n,r){return e.getInstance().dispatch(Object.assign({},r||{},{method:Je.a.PUT,url:t,data:n}))},e.path=function(t,n,r){return e.getInstance().dispatch(Object.assign({},r||{},{method:Je.a.PATH,url:t,data:n}))},e}(),ot=n(2),at=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(l.c)(t,e),t.prototype.cancel=function(e){this.emit("cancel",e),this.removeAllListeners()},t}(f.EventEmitter),st=function(e,t,n,r){if(!t||"string"!=typeof t)throw new G("A valid Filestack handle is required for remove");if(!(e.policy&&e.signature||r&&r.policy&&r.signature))throw new G("Security policy and signature are required for remove");var i=e.urls.fileApiUrl,o="".concat(i,"/").concat(t),a={key:e.apikey,policy:r&&r.policy||e.policy,signature:r&&r.signature||e.signature};return n&&(a.skip_storage=!0),it.delete(o,{filestackHeaders:!1,params:Object(ne.removeEmpty)(a)})};function ut(e){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){e.left="left",e.right="right",e.center="center",e.bottom="bottom",e.top="top"}(Pe||(Pe={})),function(e){e.left="left",e.right="right",e.center="center",e.bottom="bottom",e.top="top",e.faces="faces"}(Ee||(Ee={})),function(e){e.clip="clip",e.crop="crop",e.scale="scale",e.max="max"}(Te||(Te={})),function(e){e.linear="linear",e.gaussian="gaussian"}(je||(je={})),function(e){e.oval="oval",e.rect="rect"}(Ce||(Ce={})),function(e){e.none="none",e.low="low",e.medium="medium",e.high="high"}(Ae||(Ae={})),function(e){e.artwork="artwork",e.photo="photo"}(Re||(Re={})),function(e){e.RGB="RGB",e.CMYK="CMYK",e.Input="Input"}($e||($e={})),function(e){e.thumb="thumb",e.crop="crop",e.fill="fill"}(Qe||(Qe={})),function(e){e.fit="fit",e.auto="auto"}(Ie||(Ie={})),function(e){e.top="top",e.middle="middle",e.bottom="bottom",e.left="left",e.center="center",e.right="right"}(Me||(Me={})),function(e){e.libmp3lame="libmp3lame",e.libvorbis="libvorbis",e.libfdk_aac="libfdk_aac",e.dib_ac3="dib_ac3",e.pcm_s16le="pcm_s16le",e.mp2="mp2",e.ac3="ac3",e.eac3="eac3"}(De||(De={})),function(e){e.h264="h264",e.h264_hi="h264.hi",e.webm="webm",e["webm-hi"]="webm.hi",e.ogg="ogg",e["ogg-hi"]="ogg.hi",e["hls-variant"]="hls.variant",e.mp3="mp3",e.oga="oga",e.m4a="m4a",e.aac="aac",e.hls="hls.variant.audio"}(Ne||(Ne={})),function(e){e.desktop="desktop",e.mobile="mobile"}(Fe||(Fe={})),function(e){e.all="all",e.window="window"}(Le||(Le={})),function(e){e.portrait="portrait",e.landscape="landscape"}(qe||(qe={})),function(e){e.s3="s3",e.azure="azure",e.gcs="gcs",e.rackspace="rackspace",e.dropbox="dropbox"}(ze||(ze={})),function(e){e.private="private",e.public="public"}(Ue||(Ue={})),function(e){e.preserve="preserve",e.constrain="constrain",e.letterbox="letterbox",e.pad="pad",e.crop="crop"}(Be||(Be={}));var ct=function(e,t,n,r){void 0===n&&(n={}),void 0===r&&(r=!1),n=function e(t){for(var n={},r=Object.keys(t),i=0;i=n){var r=Math.ceil(this._file.size/1e4);return{partsCount:Math.ceil(this._file.size/r),chunkSize:r}}return{partsCount:Math.ceil(this._file.size/e),chunkSize:e}},e.prototype.getPartMetadata=function(e,t){var n=t*e;if(n>this._file.size)throw new Error("Start byte of the part is higher than buffer size");var r=Math.min(n+t,this._file.size);return{partNumber:e,startByte:n,endByte:r,size:r-n}},e.prototype.getPartByMetadata=function(e,t){return void 0===t&&(t=!0),Object(l.b)(this,void 0,void 0,(function(){var n;return Object(l.d)(this,(function(r){switch(r.label){case 0:return[4,this._file.slice(e.startByte,e.endByte)];case 1:return n=r.sent(),[2,Promise.resolve(Object(l.a)(Object(l.a)({},e),{buffer:n,md5:t?Object(ne.md5)(n):void 0}))]}}))}))},e.prototype.getChunkByMetadata=function(e,t,n,r){return void 0===r&&(r=!0),Object(l.b)(this,void 0,void 0,(function(){var i,o,a;return Object(l.d)(this,(function(s){switch(s.label){case 0:return i=e.startByte+t,o=Math.min(i+n,e.endByte),[4,this._file.slice(i,o)];case 1:return a=s.sent(),[2,Promise.resolve(Object(l.a)(Object(l.a)({},e),{buffer:a,md5:r?Object(ne.md5)(a):void 0,size:a.byteLength,startByte:i,endByte:o,offset:t}))]}}))}))},e.prototype.release=function(){this._file.release&&this._file.release()},e.prototype.toJSON=function(){return{name:this.name,status:this.status,type:this.type,size:this.size,url:this.url,handle:this.handle,uploadTags:this.uploadTags}},e}(),pt=/data:([a-zA-Z]*\/[a-zA-Z]*);base64,([^\"]*)/i,dt=function(e,t){var n,r;if(function(e){return e&&e.file&&e.name}(e)&&(n=e.name,e=e.file),function(e){return e instanceof File}(e))r=e,n=e.name;else if(function(e){if("string"!=typeof e)return!1;e.indexOf("base64")>-1&&(e=e.match(pt).pop());try{return btoa(atob(e))===e}catch(e){return!1}}(e))r=function(e,t){void 0===t&&(t=512);var n="";if(e.indexOf("base64")>-1){var r=e.match(pt);e=r.pop(),n=r[1]}for(var i=atob(e),o=[],a=0;a-1&&(this.partSize=8388608,n=!0);for(var r=t.getPartsCount(this.partSize,n),i=r.partsCount,o=r.chunkSize,a=[],s=0;s-1&&(!r.upload_type||"intelligent_ingestion"!==r.upload_type)&&(Ot("[".concat(e,"] Intelligent Ingestion is not enabled on account, switch back to regular upload and lock mode change")),t.setUploadMode("default",!0)),r):(Ot("[".concat(e,"] Incorrect start response: \n%O\n"),r),t.setPayloadStatus(e,"Failed"),Promise.reject(new G("Incorrect start response",r,X.REQUEST)))})).catch((function(n){return Ot("[".concat(e,"] Start request error %O"),n),t.setPayloadStatus(e,"Failed"),t.rejectUpload("Cannot upload file. Start request failed",n)})))},t.prototype.startPartsQueue=function(e){return Object(l.b)(this,void 0,void 0,(function(){var t,n,r,i=this;return Object(l.d)(this,(function(o){return t=this.getPayloadById(e),n=t.parts,r=n.length,Ot("[".concat(e,"] Create uploading queue from file. parts count - %d"),r),[2,new Promise((function(t,r){return Object(l.b)(i,void 0,void 0,(function(){var i,o=this;return Object(l.d)(this,(function(a){switch(a.label){case 0:return n.forEach((function(t){return o.partsQueue.add((function(){return o.startPart(e,t.partNumber)})).catch((function(t){return o.setPayloadStatus(e,"Failed"),Ot("[".concat(e,"] Failed to upload part %s"),t.message),o.partsQueue.pause(),o.partsQueue.clear(),r(t)}))})),Ot("[".concat(e,"] All tasks for %s enqueued. Start processing main upload queue"),e),this.emit("start"),this.partsQueue.start(),i=t,[4,this.partsQueue.onIdle()];case 1:return i.apply(void 0,[a.sent()]),[2]}}))}))}))]}))}))},t.prototype.startPart=function(e,t){return Ot("[".concat(e,"] Start processing part ").concat(t," with mode ").concat(this.uploadMode)),this.getPayloadById(e).file.status="Progress",("intelligent"!==this.uploadMode?this.uploadRegular:this.uploadIntelligent).apply(this,[e,t])},t.prototype.getS3PartMetadata=function(e,t,n){var r=this,i=this.getUploadUrl(e);Ot("[".concat(e,"] Get data for part ").concat(t.partNumber,", url ").concat(i,", Md5: ").concat(t.md5,", Size: ").concat(t.size));var o=Object(l.a)(Object(l.a)({},this.getDefaultFields(e,["apikey","uri","region","signature","policy","upload_id","fii"])),{part:t.partNumber+1,size:t.size,offset:n});return this.integrityCheck&&t.md5&&(o.md5=t.md5),it.post("".concat(i,"/multipart/upload"),o,{headers:this.getDefaultHeaders(e),cancelToken:this.cancelToken,timeout:this.timeout,retry:this.retryConfig}).catch((function(t){return r.setPayloadStatus(e,"Failed"),r.rejectUpload("Cannot get part metadata",t)}))},t.prototype.uploadRegular=function(e,t){return Object(l.b)(this,void 0,void 0,(function(){var n,r,i,o,a,s,u=this;return Object(l.d)(this,(function(c){switch(c.label){case 0:return n=this.getPayloadById(e),r=n.parts[t],[4,n.file.getPartByMetadata(r,this.integrityCheck)];case 1:return i=c.sent(),[4,this.getS3PartMetadata(e,i)];case 2:return o=c.sent(),a=o.data,s=o.headers,Ot("[".concat(e,"] Received part ").concat(t," info body: \n%O\n headers: \n%O\n"),a,s),[2,it.put(a.url,i.buffer,{cancelToken:this.cancelToken,timeout:this.timeout,headers:a.headers,filestackHeaders:!1,onProgress:function(n){return u.onProgressUpdate(e,t,n.loaded)},retry:this.retryConfig&&"fallback"!==this.uploadMode?this.retryConfig:void 0}).then((function(n){if(!n.headers.etag)throw i=null,new G("Cannot upload file, check S3 bucket settings","Etag header is not exposed in CORS settings",X.REQUEST);return u.setPartETag(e,t,n.headers.etag),Ot("[".concat(e,"] S3 Upload response headers for ").concat(t,": \n%O\n"),n.headers),u.onProgressUpdate(e,t,i.size),i=null,n})).catch((function(n){var r=n&&n.response?n.response:null;if(r&&403===r.status&&r.data&&r.data.Error&&r.data.Error.code){var o=r.data.Error.code;return"RequestTimeTooSkewed"===(Array.isArray(o)&&(o=o.pop()),o)?u.startPart(e,t):Promise.reject(new G("Cannot upload file",r.data.Error,X.REQUEST))}return i=null,n instanceof G?Promise.reject(n):(u.onProgressUpdate(e,t,0),"fallback"===u.uploadMode&&!u.isModeLocked||"intelligent"===u.uploadMode?(Ot("[".concat(e,"] Regular upload failed. Switching to intelligent ingestion mode")),u.setUploadMode("intelligent"),u.startPart(e,t)):u.rejectUpload("Cannot upload file part",n))}))]}}))}))},t.prototype.uploadIntelligent=function(e,t){return Object(l.b)(this,void 0,void 0,(function(){var n=this;return Object(l.d)(this,(function(r){return[2,this.uploadNextChunk(e,t).then((function(){return n.commitPart(e,t)}))]}))}))},t.prototype.uploadNextChunk=function(e,t,n){return void 0===n&&(n=this.intelligentChunkSize),Object(l.b)(this,void 0,void 0,(function(){var r,i,o,a,s=this;return Object(l.d)(this,(function(u){switch(u.label){case 0:return r=this.getPayloadById(e),i=r.parts[t],n=i.size-i.offset,[4,r.file.getChunkByMetadata(i,i.offset,n,this.integrityCheck)];case 1:return o=u.sent(),Ot("[".concat(e,"] PartNum: ").concat(t,", PartSize: ").concat(i.size,", StartByte: ").concat(i.startByte,", Offset: ").concat(i.offset,", ChunkSize: ").concat(o.size,",\n Left: ").concat(i.size-i.offset-o.size)),[4,this.getS3PartMetadata(e,o,i.offset).catch((function(r){return Ot("[".concat(e,"] Getting chunk data for ii failed %O, Chunk size: ").concat(n,", offset ").concat(i.offset,", part ").concat(t),r),Promise.reject(r)}))];case 2:return a=u.sent().data,[2,it.put(a.url,o.buffer,{cancelToken:this.cancelToken,timeout:this.timeout,headers:a.headers,filestackHeaders:!1,onProgress:function(n){return i?s.onProgressUpdate(e,t,i.offset+n.loaded):null}}).then((function(r){s.onProgressUpdate(e,t,i.offset+o.size);var a=Math.min(i.offset+n,i.size);return Ot("[".concat(e,"] S3 Chunk uploaded! offset: ").concat(i.offset,", part ").concat(t,"! response headers for ").concat(t,": \n%O\n"),r.headers),s.setPartData(e,t,"offset",a),a===i.size?Promise.resolve(r):(i=null,o=null,s.uploadNextChunk(e,t,n))})).catch((function(r){var a=r&&r.response?r.response:null;if(a&&403===a.status&&a.data&&a.data.Error&&a.data.Error.code){var u=a.data.Error.code;return"RequestTimeTooSkewed"===(Array.isArray(u)&&(u=u.pop()),u)?s.startPart(e,t):Promise.reject(new G("Cannot upload file",a.data.Error,X.REQUEST))}s.onProgressUpdate(e,t,i.offset);var c=Math.ceil(n/2);return c<32768?(Ot("[".concat(e,"] Minimal chunk size limit. Upload file failed!")),Promise.reject(new G("Min chunk size reached",r.data,X.REQUEST))):Object(gt.e)(r)?(Ot("[".concat(e,"] Request network error. Retry with new chunk size: ").concat(c)),s.uploadNextChunk(e,t,c)):(i=null,o=null,s.rejectUpload("Cannot upload file part (FII)",r))}))]}}))}))},t.prototype.commitPart=function(e,t){var n=this,r=this.getPayloadById(e),i=r.parts[t];return it.post("".concat(this.getUploadUrl(e),"/multipart/commit"),Object(l.a)(Object(l.a)({},this.getDefaultFields(e,["apikey","region","upload_id","policy","signature","uri"])),{size:r.file.size,part:i.partNumber+1}),{cancelToken:this.cancelToken,timeout:this.timeout,headers:this.getDefaultHeaders(e),retry:this.retryConfig}).then((function(t){return Ot("[".concat(e,"] Commit Part number ").concat(i.partNumber,". Response: %O"),t.data),t})).catch((function(e){return n.rejectUpload("Cannot commit file part metadata",e)}))},t.prototype.completeRequest=function(e){var t=this,n=this.getPayloadById(e),r=[];Ot("[".concat(e,"] Run complete request"));for(var i=n.parts,o=i.length,a=0;a-1:!!this.availableTypes.length},e.prototype.getItem=function(e,t){var n=this.getStore(t);if(St("getItem %s from %O",e,n),n)return n.getItem(e)},e.prototype.setItem=function(e,t,n){var r=this.getStore(n);if(St("setItem %s to %O",e,r),r)return r.setItem(e,t)},e.prototype.removeItem=function(e,t){var n=this.getStore(t);if(St("removeItem %s from %O",e,n),n)return n.removeItem(e)},e.prototype.getStore=function(e){if(St("get store with pref type - %s",e),this.hasAccess(e))switch(e){case ft.LOCAL:return window.localStorage;case ft.SESSION:return window.sessionStorage;default:return window[this.availableTypes[0]]}else St("User dont have access to any storage")},e}();!function(e){e.SESSION="sessionStorage",e.LOCAL="localStorage"}(ft||(ft={}));var Pt,Et="__fs_picker_token",Tt=function(){function e(e,t){this.cache=!1,this.session=e,this.storeAdapter=new _t,this.cloudApiUrl=e.urls.cloudApiUrl,t&&t.sessionCache&&(this.cache=t.sessionCache)}return Object.defineProperty(e.prototype,"token",{get:function(){if(this.cache){var e=this.storeAdapter.getItem(Et,ft.LOCAL);if(e)return e}return this.isInAppBrowser?this.storeAdapter.getItem(Et,ft.SESSION):this._token},set:function(e){this.cache&&this.storeAdapter.setItem(Et,e,ft.LOCAL),this.isInAppBrowser&&this.storeAdapter.setItem(Et,e,ft.SESSION),this._token=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInAppBrowser",{get:function(){return!!(this.session&&this.session.prefetch&&this.session.prefetch.settings&&this.session.prefetch.settings.inapp_browser)&&this.session.prefetch.settings.inapp_browser},enumerable:!1,configurable:!0}),e.prototype.list=function(e,t,n){var r=this,i={apikey:this.session.apikey,clouds:e,flow:"web",token:this.token};n&&(Array.isArray(n)||(n=[n]),n.includes("application/x-subrip")&&!n.includes("application/octet-stream")&&n.push("application/octet-stream"),i.accept=n),this.isInAppBrowser&&(i.appurl=this.currentAppUrl()),this.session.policy&&this.session.signature&&(i.policy=this.session.policy,i.signature=this.session.signature);var o={};if(t){var a=new at;t.cancel=a.cancel.bind(a),o.cancelToken=a}return it.post("".concat(this.cloudApiUrl,"/folder/list"),i,o).then((function(e){return e.data&&e.data.token&&(r.token=e.data.token),e.data}))},e.prototype.store=function(e,t,n,r,i,o){var a,s=this;void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o=null),void 0===n.location&&(n.location="s3");var u={apikey:this.session.apikey,token:this.token,flow:"web",upload_tags:o||void 0,clouds:(a={},a[e]={path:t,store:Object(ne.removeEmpty)(n)},a)};"customsource"===e&&r.customSourcePath&&(u.clouds.customsource.customSourcePath=r.customSourcePath),"customsource"===e&&r.customSourceContainer&&(u.clouds.customsource.customSourceContainer=r.customSourceContainer),this.session.policy&&this.session.signature&&(u.policy=this.session.policy,u.signature=this.session.signature);var c={};if(i){var l=new at;i.cancel=l.cancel.bind(l),c.cancelToken=l}return it.post("".concat(this.cloudApiUrl,"/store/"),u,c).then((function(t){return t.data&&t.data.token&&(s.token=t.data.token),t.data&&t.data[e]?t.data[e]:t.data}))},e.prototype.logout=function(e){var t,n={apikey:this.session.apikey,flow:"web",token:this.token};return e?n.clouds=((t={})[e]={},t):(this.cache&&this.storeAdapter.removeItem(Et,ft.LOCAL),this.isInAppBrowser&&this.storeAdapter.removeItem(Et,ft.SESSION)),it.post("".concat(this.cloudApiUrl,"/auth/logout"),n).then((function(t){return t.data&&t.data[e]?t.data[e]:t.data}))},e.prototype.metadata=function(e,t){var n={apikey:this.session.apikey,url:e,headers:t};return this.session.policy&&this.session.signature&&(n.policy=this.session.policy,n.signature=this.session.signature),it.post("".concat(this.cloudApiUrl,"/metadata"),n).then((function(e){return e.data}))},e.prototype.tokInit=function(e){if("video"!==e&&"audio"!==e)throw new G("Type must be one of video or audio.");return it.post("".concat(this.cloudApiUrl,"/recording/").concat(e,"/init")).then((function(e){return e.data}))},e.prototype.tokStart=function(e,t,n){if("video"!==e&&"audio"!==e)throw new G("Type must be one of video or audio.");var r={apikey:t,session_id:n};return it.post("".concat(this.cloudApiUrl,"/recording/").concat(e,"/start"),r).then((function(e){return e.data}))},e.prototype.tokStop=function(e,t,n,r){if("video"!==e&&"audio"!==e)throw new G("Type must be one of video or audio.");var i={apikey:t,session_id:n,archive_id:r};return it.post("".concat(this.cloudApiUrl,"/recording/").concat(e,"/stop"),i).then((function(e){return e.data}))},e.prototype.currentAppUrl=function(){if(window.URLSearchParams){var e=new URLSearchParams(window.location.search);return e.set("fs-tab","init"),"".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname,"?").concat(e.toString())}},e}(),jt=n(33),Ct=n.n(jt);!function(e){e.PICKER="picker",e.TRANSFORM_UI="transform_ui"}(Pt||(Pt={}));var At,Rt,$t=function(){function e(e){this.session=e instanceof It?e.session:e}return e.prototype.getConfig=function(e){var t=e.pickerOptions,n=e.settings,r=e.permissions,i=e.events;return Object(l.b)(this,void 0,void 0,(function(){var e,o,a=this;return Object(l.d)(this,(function(s){return e={apikey:this.session.apikey},this.session.policy&&this.session.signature&&(e.security={policy:this.session.policy,signature:this.session.signature}),n=n?(n=n.concat(["inapp_browser"])).filter((function(e,t){return n.indexOf(e)===t})):["inapp_browser"],t&&Object.keys(t).length&&(o=Object(ne.cleanUpCallbacks)(Ct()(Object(l.a)({},t)))),e=Object(l.a)(Object(l.a)({},e),{permissions:r,settings:n,picker_config:o,events:i}),this.session.prefetch=null,[2,it.post("".concat(this.session.urls.uploadApiUrl,"/prefetch"),e).then((function(e){if(200!==e.status)throw new G("There is a problem with prefetch request");var n=e.data;return n.updated_config?(n.pickerOptions=a.reassignCallbacks(t,n.updated_config||{}),delete n.updated_config):n.pickerOptions=t,a.session.prefetch=n,n}))]}))}))},e.prototype.reassignCallbacks=function(e,t){if(!e||0===Object.keys(e).length)return e;for(var n in e)"function"==typeof e[n]&&(t[n]=e[n]),e[n]===Object(e[n])&&(t[n]=this.reassignCallbacks(e[n],t[n]));return t},e}();!function(e){e.cw="CW",e.ccw="CCW"}(At||(At={})),function(e){e.inline="inline",e.overlay="overlay",e.dropPane="dropPane"}(Rt||(Rt={}));var Qt=function(){function e(e,t){var n=te(Ge)(t);n.errors.length&&(n.errors.forEach((function(e){if(!e.path.includes("fromSources"))throw new G("Invalid picker params",n.errors,X.VALIDATION);console.warn('Warning: Invalid source "'.concat(e.instance,'" found and removed!')),t.fromSources=t.fromSources.filter((function(t){return t!==e.instance}))})),t.fromSources.length||delete t.fromSources),this._initialized=this.loadModule(e,t)}return e.prototype.open=function(){return Object(l.b)(this,void 0,void 0,(function(){return Object(l.d)(this,(function(e){switch(e.label){case 0:return[4,this._initialized];case 1:return[4,e.sent().open()];case 2:return e.sent(),[2]}}))}))},e.prototype.crop=function(e){return Object(l.b)(this,void 0,void 0,(function(){return Object(l.d)(this,(function(t){switch(t.label){case 0:return[4,this._initialized];case 1:return[4,t.sent().crop(e)];case 2:return t.sent(),[2]}}))}))},e.prototype.close=function(){return Object(l.b)(this,void 0,void 0,(function(){return Object(l.d)(this,(function(e){switch(e.label){case 0:return[4,this._initialized];case 1:return[4,e.sent().close()];case 2:return e.sent(),[2]}}))}))},e.prototype.cancel=function(){return Object(l.b)(this,void 0,void 0,(function(){return Object(l.d)(this,(function(e){switch(e.label){case 0:return[4,this._initialized];case 1:return[4,e.sent().cancel()];case 2:return e.sent(),[2]}}))}))},e.prototype.loadModule=function(e,t){return Object(l.b)(this,void 0,void 0,(function(){var n;return Object(l.d)(this,(function(r){switch(r.label){case 0:return n=e.session.urls.pickerUrl,[4,o(s.PICKER,n)];case 1:return[2,new(r.sent())(e,t)]}}))}))},e}();Z("addBreadcrumb",{category:"sdk",message:"filestack-js-sdk scope"});var It=function(e){function t(t,n){var r=e.call(this)||this;if(r.options=n,r.forwardErrors=!0,n&&n.forwardErrors&&(r.forwardErrors=n.forwardErrors),!t||"string"!=typeof t||0===t.length)throw new Error("An apikey is required to initialize the Filestack client");var i=Y.urls;if(r.session={apikey:t,urls:i},n){var o=n.cname,a=n.security;r.setSecurity(a),r.setCname(o)}return r.prefetchInstance=new $t(r.session),r.cloud=new Tt(r.session,n),r}return Object(l.c)(t,e),Object.defineProperty(t.prototype,"utils",{get:function(){return ne},enumerable:!1,configurable:!0}),t.prototype.prefetch=function(e){return this.prefetchInstance.getConfig(e)},t.prototype.setSecurity=function(e){if(e&&(!e.policy||!e.signature))throw new G("Both policy and signature are required for client security");e&&e.policy&&e.signature&&(this.session.policy=e.policy,this.session.signature=e.signature)},t.prototype.setCname=function(e){e&&0!==e.length&&(this.session.cname=e,this.session.urls=ne.resolveHost(this.session.urls,e))},t.prototype.logout=function(e){return this.cloud.logout(e)},t.prototype.metadata=function(e,t,n){return function(e,t,n,r){if(!t||"string"!=typeof t)throw new G("A valid Filestack handle is required for metadata");var i=te(He)(n);if(i.errors.length)throw new G("Invalid metadata params",i.errors);var o=Object(l.a)({},n);o.source_url=o.sourceUrl,o.policy=r&&r.policy||e.policy,o.signature=r&&r.signature||e.signature;var a="".concat(e.urls.fileApiUrl,"/").concat(t,"/metadata");return new Promise((function(e,n){it.get(a,{params:Object(ne.removeEmpty)(o),filestackHeaders:!1}).then((function(n){return e(Object(l.a)(Object(l.a)({},n.data),{handle:t}))})).catch(n)}))}(this.session,e,t,n)},t.prototype.picker=function(e){return function(e,t){return new Qt(e,t)}(this,e)},t.prototype.preview=function(e,t){return function(e,t,n){if(!t||"string"!=typeof t)throw new Error("A valid Filestack handle or storage alias is required for preview");var r=te(Xe)(n);if(r.errors.length)throw new G("Invalid preview params",r.errors,X.VALIDATION);var i=Object(ne.removeEmpty)(n||{}),o=function(e,t,n,r){var i=Object(l.a)({},n),o=e.policy,a=e.signature,s=a&&o,u=[e.urls.cdnUrl],c=i.css&&encodeURIComponent('"'.concat(i.css,'"')),f=c?"preview=css:".concat(c):"preview";return-1!==t.indexOf("src:")?u.push("".concat(e.apikey,"/").concat(f)):u.push(f),s&&u.push("security=policy:".concat(o,",signature:").concat(a)),u.push(t),u.join("/")}(e,t,i);if(i&&i.id){var a=i.id,s=document.createElement("iframe"),u=document.getElementById(a);if(s.src=o,s.width="100%",s.height="100%",!u)throw new Error('DOM Element with id "'.concat(a,'" not found.'));return u.appendChild(s)}return window.open(o,t)}(this.session,e,t)},t.prototype.remove=function(e,t){return st(this.session,e,!1,t)},t.prototype.removeMetadata=function(e,t){return st(this.session,e,!0,t)},t.prototype.storeURL=function(e,t,n,r,i,o,a){return function(e){var t=e.session,n=e.url,r=e.storeParams,i=e.token,o=e.security,a=e.uploadTags,s=e.headers,u=e.workflowIds;if(!n||"string"!=typeof n)return Promise.reject(new G("url is required for storeURL"));var c=te(We)(r);if(c.errors.length)return Promise.reject(new G("Invalid store params",c.errors));t.policy=o&&o.policy||t.policy,t.signature=o&&o.signature||t.signature;var f=new Ve(n,t.apikey);f.store(r),t.policy&&t.signature&&f.security({policy:t.policy,signature:t.signature});var h={};if(i){var p=new at;i.cancel=p.cancel.bind(p),h.cancelToken=p}var d=[n];return s&&(d=[{source:n,headers:s}]),u&&u.length>0&&f.addTask("store",{workflows:u}),it.post("".concat(t.urls.processUrl,"/process"),{apikey:t.apikey,sources:d,tasks:f.getTasks(),upload_tags:a},h).then((function(e){if(e.data&&e.data.handle)return e.data.upload_tags&&(e.data.uploadTags=e.data.upload_tags,delete e.data.upload_tags),Object(l.a)(Object(l.a)({},e.data),{mimetype:e.data.type});throw new G("Invalid store response ".concat(JSON.stringify(e.data)))}))}({session:this.session,url:e,storeParams:t,token:n,security:r,uploadTags:i,headers:o,workflowIds:a})},t.prototype.retrieve=function(e,t,n){return function(e,t,n,r){if(void 0===n&&(n={}),!t||0===t.length||"string"!=typeof t)throw new G("File handle is required");console.info("Retrieve method is deprecated and it will be removed. Please use metadata or download");var i=te(Ke)(n);if(i.errors.length)throw new G("Invalid retrieve params",i.errors);var o=Object(l.a)({},n);o.key=e.apikey,o.policy=r&&r.policy||e.policy,o.signature=r&&r.signature||e.signature;var a,s,u=Je.a.GET;if(o.head&&(u=Je.a.HEAD,delete o.head),o.extension&&o.extension.length&&(a=o.extension,delete o.extension),o.metadata){if(u===Je.a.HEAD)throw new G("Head and metadata options cannot be used together");s=o.metadata,delete o.metadata}var c="".concat(e.urls.fileApiUrl,"/").concat(t)+(a?"+".concat(a):"")+(s?"/metadata":"");return new Promise((function(e,t){it.dispatch(c,{method:u,filestackHeaders:!1,params:Object(ne.removeEmpty)(o)}).then((function(t){return e(u===Je.a.HEAD?t.headers:t.data)})).catch(t)}))}(this.session,e,t,n)},t.prototype.download=function(e,t){return function(e,t,n){var r=new Ve(t,e.apikey),i=n&&n.policy||e.policy,o=n&&n.signature||e.signature;return i&&o&&r.security({signature:o,policy:i}),it.dispatch(r.toString(),{method:Je.a.GET,blobResponse:!0})}(this.session,e,t)},t.prototype.transform=function(e,t,n){return void 0===n&&(n=!1),ct(this.session,e,t,n)},t.prototype.upload=function(e,t,n,r,i){var o=this,a=new kt(t,n);return a.setSession(this.session),r&&a.setToken(r),i&&a.setSecurity(i),a.on("start",(function(){return o.emit("upload.start")})),a.on("error",(function(e){o.forwardErrors&&W((function(r){r.setTag("filestack-apikey",o.session.apikey),r.setTag("filestack-version",ne.getVersion()),r.setExtra("filestack-options",o.options),r.setExtras({uploadOptions:t,storeOptions:n,details:e.details}),e.message="FS-".concat(e.message),V(e)})),o.emit("upload.error",e)})),a.upload(e,t&&t.altText)},t.prototype.multiupload=function(e,t,n,r,i){var o=this,a=new kt(t,n);return a.setSession(this.session),r&&a.setToken(r),i&&a.setSecurity(i),a.on("start",(function(){return o.emit("upload.start")})),a.on("error",(function(e){W((function(r){r.setTag("filestack-apikey",o.session.apikey),r.setTag("filestack-version",ne.getVersion()),r.setExtra("filestack-options",o.options),r.setExtras(e.details),r.setExtras({uploadOptions:t,storeOptions:n}),V(e)})),o.emit("upload.error",e)})),a.multiupload(e)},t}(f.EventEmitter),Mt=function(e,t){return new It(e,t)},Dt=Mt,Nt="3.38.5";a(s.FILESTACK_SDK,Mt,{version:"3.38.5"})},,function(e,t,n){(function(e){n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(6),i=n(11),o={nowSeconds:function(){return Date.now()/1e3}},a=Object(i.b)()?function(){try{return Object(i.a)(e,"perf_hooks").performance}catch(e){return}}():function(){var e=Object(r.a)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},u=o.nowSeconds.bind(o),c=s.nowSeconds.bind(s);!function(){var e=Object(r.a)().performance;if(e&&e.now){var t=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+t-n):36e5,o=i<36e5,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+t-n):36e5;(o||s<36e5)&&(i<=s&&e.timeOrigin)}}()}).call(this,n(29)(e))}]);const _filestack$Filestack=filestack.Filestack,_filestack$init=filestack.init,_filestack$version=filestack.version,_filestack$EAlignOptions=filestack.EAlignOptions,_filestack$EAlignFacesOptions=filestack.EAlignFacesOptions,_filestack$EFitOptions=filestack.EFitOptions,_filestack$EBlurMode=filestack.EBlurMode,_filestack$EShapeType=filestack.EShapeType,_filestack$ENoiseType=filestack.ENoiseType,_filestack$EStyleType=filestack.EStyleType,_filestack$EColorspaceType=filestack.EColorspaceType,_filestack$ECropfacesType=filestack.ECropfacesType,_filestack$ESmartCropMode=filestack.ESmartCropMode,_filestack$EImageWatermarkPosition=filestack.EImageWatermarkPosition,_filestack$EAudioTypes=filestack.EAudioTypes,_filestack$EVideoTypes=filestack.EVideoTypes,_filestack$EUrlscreenshotAgent=filestack.EUrlscreenshotAgent,_filestack$EUrlscreenshotMode=filestack.EUrlscreenshotMode,_filestack$EUrlscreenshotOrientation=filestack.EUrlscreenshotOrientation,_filestack$EVideoLocations=filestack.EVideoLocations,_filestack$EVideoAccess=filestack.EVideoAccess,_filestack$EVideoAccessMode=filestack.EVideoAccessMode,_filestack$transform=filestack.transform,_filestack$Align=filestack.Align,_filestack$FitOptions=filestack.FitOptions,_filestack$BlurMode=filestack.BlurMode,_filestack$ShapeType=filestack.ShapeType,_filestack$NoiseType=filestack.NoiseType,_filestack$StyleType=filestack.StyleType,_filestack$ColorspaceType=filestack.ColorspaceType,_filestack$CropfacesType=filestack.CropfacesType,_filestack$ImageWatermarkPosition=filestack.ImageWatermarkPosition,_filestack$SmartCropMode=filestack.SmartCropMode,_filestack$AudioTypes=filestack.AudioTypes,_filestack$VideoTypes=filestack.VideoTypes,_filestack$URLScreenshotAgent=filestack.URLScreenshotAgent,_filestack$URLScreenshotMode=filestack.URLScreenshotMode,_filestack$URLScreenshotOrientation=filestack.URLScreenshotOrientation,_filestack$Locations=filestack.Locations,_filestack$VideoAccess=filestack.VideoAccess,_filestack$VideoAccessMode=filestack.VideoAccessMode,_filestack$EnhancePreset=filestack.EnhancePreset,_filestack$Filelink=filestack.Filelink,_filestack$FilestackErrorType=filestack.FilestackErrorType,_filestack$FsHttpMethod=filestack.FsHttpMethod,_filestack$FsRequest=filestack.FsRequest,_filestack$FsRequestErrorCode=filestack.FsRequestErrorCode,_filestack$FsRequestError=filestack.FsRequestError,_filestack$FsCancelToken=filestack.FsCancelToken,_filestack$resolveCdnUrl=filestack.resolveCdnUrl,_filestack$resolveHost=filestack.resolveHost,_filestack$removeEmpty=filestack.removeEmpty,_filestack$uniqueTime=filestack.uniqueTime,_filestack$uniqueId=filestack.uniqueId,_filestack$extensionToMime=filestack.extensionToMime,_filestack$sanitizeName=filestack.sanitizeName,_filestack$filterObject=filestack.filterObject,_filestack$cleanUpCallbacks=filestack.cleanUpCallbacks,_filestack$md5=filestack.md5,_filestack$b64=filestack.b64,_filestack$getVersion=filestack.getVersion,_filestack$isMobile=filestack.isMobile,_filestack$isFacebook=filestack.isFacebook,_filestack$TransformSchema=filestack.TransformSchema,_filestack$getSecurity=filestack.getSecurity,_filestack$validateWebhookSignature=filestack.validateWebhookSignature,_filestack$Client=filestack.Client,_filestack$FilestackError=filestack.FilestackError,_filestack$PickerDisplayMode=filestack.PickerDisplayMode,_filestack$getMimetype=filestack.getMimetype,_filestack$PrefetchEvents=filestack.PrefetchEvents},796:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0),i=n.n(r),o={then:function(){}};function a(e){var t=e.freeze,n=e.children;if(t)throw o;return i.a.createElement(r.Fragment,null,n)}function s(e){var t=e.freeze,n=e.children,o=e.placeholder,s=void 0===o?null:o;return i.a.createElement(r.Suspense,{fallback:s},i.a.createElement(a,{freeze:t},n))}},797:function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n(9),i=n(7),o=n(11);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=r.level&&"codeOnly"!==this.markerType?this.set(e,0,n.level):n.empty&&0===n.level&&0!==r.level?this.set(e,0,0):r.level>n.level?this.set(e,0,n.level+1):this.set(e,0,r.level)}var i=d(e.text,this.state.tabSize),o=Math.floor(i/this.unitWidth);return this.set(e,i,o)}},{key:"closestNonEmpty",value:function(e,t){for(var n=e.number+t;-1===t?n>=1:n<=this.state.doc.lines;){if(this.has(n)){var r=this.get(n);if(!r.empty)return r}var i=this.state.doc.line(n);if(i.text.trim().length){var o=d(i.text,this.state.tabSize),a=Math.floor(o/this.unitWidth);return this.set(i,o,a)}n+=t}var s=this.state.doc.line(-1===t?1:this.state.doc.lines);return this.set(s,0,0)}},{key:"findAndSetActiveLines",value:function(){var e=p(this.state);if(this.has(e)){var t=this.get(e);if(this.has(t.line.number+1)){var n=this.get(t.line.number+1);n.level>t.level&&(t=n)}if(this.has(t.line.number-1)){var r=this.get(t.line.number-1);r.level>t.level&&(t=r)}if(0!==t.level){var i,o;for(t.active=t.level,i=t.line.number;i>1;i--)if(this.has(i-1)){var a=this.get(i-1);if(a.level0&&u.push(y("--indent-marker-bg-color",r,t,s,c)),u.push(y("--indent-marker-active-bg-color",i,t,a-1,1)),a!==o&&u.push(y("--indent-marker-bg-color",r,t,a,o-a))}else u.push(y("--indent-marker-bg-color",r,t,s,o-s));return u.join(",")}var O=function(){function e(t){s(this,e),this.view=t,this.unitWidth=Object(r.y)(t.state),this.currentLineNumber=p(t.state).number,this.generate(t.state)}return c(e,[{key:"update",value:function(e){var t=Object(r.y)(e.state),n=t!==this.unitWidth;n&&(this.unitWidth=t);var i=p(e.state).number,o=i!==this.currentLineNumber;this.currentLineNumber=i;var a=e.state.facet(m).highlightActiveBlock&&o;(e.docChanged||e.viewportChanged||n||a)&&this.generate(e.state)}},{key:"generate",value:function(e){var t,n=new i.l,r=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.state,r=new Set,i=f(e.visibleRanges);try{for(i.s();!(t=i.n()).done;)for(var o=t.value,a=o.from,s=o.to,u=a;u<=s;){var c=n.doc.lineAt(u);r.has(c)||r.add(c),u=c.to+1}}catch(e){i.e(e)}finally{i.f()}return r}(this.view,e),a=e.facet(m),s=a.hideFirstIndent,u=a.markerType,c=a.thickness,l=a.activeThickness,h=new v(r,e,this.unitWidth,u),p=f(r);try{for(p.s();!(t=p.n()).done;){var d=t.value,g=h.get(d.number);if(null==g?void 0:g.level){var y=b(g,this.unitWidth,s,c,l);n.add(d.from,d.from,o.a.line({class:"cm-indent-markers",attributes:{style:"--indent-markers: ".concat(y)}}))}}}catch(e){p.e(e)}finally{p.f()}this.decorations=n.finish()}}]),e}();function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[m.of(e),g(e.colors),o.e.fromClass(O,{decorations:function(e){return e.decorations}})]}},799:function(e,t,n){"use strict";function r(e){return e.transaction}n.d(t,"a",(function(){return r}))},800:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(69),i=n(490),o=n(155),a=n(799),s=n(482);function u(e,t,n){const o=t.getOptions(),{publicKey:a}=t.getDsn()||{},{segment:s}=n&&n.getUser()||{},u=Object(r.c)({environment:o.environment||i.a,release:o.release,user_segment:s,public_key:a,trace_id:e});return t.emit&&t.emit("createDsc",u),u}function c(e){const t=Object(o.e)();if(!t)return{};const n=u(Object(s.b)(e).trace_id||"",t,Object(o.f)()),r=Object(a.a)(e);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:c,source:l}=r.metadata;null!=c&&(n.sample_rate=`${c}`);const f=Object(s.b)(r);return l&&"url"!==l&&(n.transaction=f.description),n.sampled=String(Object(s.a)(r)),t.emit&&t.emit("createDsc",n),n}},801:function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return p}));var r=n(92),i=n(487),o=n(242),a=n(37),s=n(497),u=n(490),c=n(493),l=n(567),f=n(585),h=n(482);function p(e,t,n,p,m,v){const{normalizeDepth:g=3,normalizeMaxBreadth:y=1e3}=e,b={...t,event_id:t.event_id||n.event_id||Object(r.f)(),timestamp:t.timestamp||Object(i.a)()},O=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:a=250}=t;"environment"in e||(e.environment="environment"in t?n:u.a);void 0===e.release&&void 0!==r&&(e.release=r);void 0===e.dist&&void 0!==i&&(e.dist=i);e.message&&(e.message=Object(o.d)(e.message,a));const s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=Object(o.d)(s.value,a));const c=e.request;c&&c.url&&(c.url=Object(o.d)(c.url,a))}(b,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(b,O),void 0===t.type&&function(e,t){const n=a.a._sentryDebugIds;if(!n)return;let r;const i=d.get(t);i?r=i:(r=new Map,d.set(t,r));const o=Object.keys(n).reduce(((e,i)=>{let o;const a=r.get(i);a?o=a:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=o[e.filename])}))}))}catch(e){}}(b,e.stackParser);const w=function(e,t){if(!t)return e;const n=e?e.clone():new l.a;return n.update(t),n}(p,n.captureContext);n.mechanism&&Object(r.a)(b,n.mechanism);const x=m&&m.getEventProcessors?m.getEventProcessors():[],k=Object(l.b)().getScopeData();if(v){const e=v.getScopeData();Object(f.b)(k,e)}if(w){const e=w.getScopeData();Object(f.b)(k,e)}const S=[...n.attachments||[],...k.attachments];S.length&&(n.attachments=S),Object(f.a)(b,k);const _=[...x,...Object(c.b)(),...k.eventProcessors];return Object(c.c)(_,b,n).then((e=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"==typeof g&&g>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:Object(s.a)(e.data,t,n)}})))},...e.user&&{user:Object(s.a)(e.user,t,n)},...e.contexts&&{contexts:Object(s.a)(e.contexts,t,n)},...e.extra&&{extra:Object(s.a)(e.extra,t,n)}};e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Object(s.a)(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>{const r=Object(h.b)(e).data;return r&&(e.data=Object(s.a)(r,t,n)),e})));return r}(e,g,y):e)))}const d=new WeakMap;function m(e){if(e)return function(e){return e instanceof l.a||"function"==typeof e}(e)||function(e){return Object.keys(e).some((e=>v.includes(e)))}(e)?{captureContext:e}:e}const v=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},802:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(10),i=n(571),o=n(166);function a(e){return new o.a((function(t,n){return new i.a((function(r){var i,o,a;try{i=n(t).subscribe({next:function(i){i.errors&&(a=e({graphQLErrors:i.errors,response:i,operation:t,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.next(i)},error:function(i){(a=e({operation:t,networkError:i,graphQLErrors:i&&i.result&&i.result.errors||void 0,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.error(i)},complete:function(){a||r.complete.bind(r)()}})}catch(i){e({networkError:i,operation:t,forward:n}),r.error(i)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}}))}))}!function(e){function t(t){var n=e.call(this)||this;return n.link=a(t),n}Object(r.__extends)(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)}}(o.a)},803:function(e,t,n){var r,i,o,a,s;r=n(968),i=n(884).utf8,o=n(969),a=n(884).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):i.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=r.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,f=-1732584194,h=271733878,p=0;p>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[u>>>5]|=128<>>9<<4)]=u;var d=s._ff,m=s._gg,v=s._hh,g=s._ii;for(p=0;p>>0,l=l+b>>>0,f=f+O>>>0,h=h+w>>>0}return r.endian([c,l,f,h])})._ff=function(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+(i>>>0)+a;return(s<>>32-o)+t},s._gg=function(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+(i>>>0)+a;return(s<>>32-o)+t},s._hh=function(e,t,n,r,i,o,a){var s=e+(t^n^r)+(i>>>0)+a;return(s<>>32-o)+t},s._ii=function(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+(i>>>0)+a;return(s<>>32-o)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(s(e,t));return t&&t.asBytes?n:t&&t.asString?a.bytesToString(n):r.bytesToHex(n)}},813:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a}));const r=/\(error: (.*)\)/,i=/captureMessage|captureException/;function o(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{const o=[],a=e.split("\n");for(let e=n;e1024)continue;const i=r.test(n)?n.replace(r,"$1"):n;if(!i.match(/\S*Error: /)){for(const e of t){const t=e(i);if(t){o.push(t);break}}if(o.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop();t.reverse(),i.test(t[t.length-1].function||"")&&(t.pop(),i.test(t[t.length-1].function||"")&&t.pop());return t.slice(0,50).map((e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"})))}(o)}}function a(e){return Array.isArray(e)?o(...e):e}const s="";function u(e){try{return e&&"function"==typeof e&&e.name||s}catch(e){return s}}},816:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s}));var r=n(10),i=n(771),o={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},a=function(e,t){return t(e)};function s(e,t){for(var n=[],o=2;o-1;){if(x=void 0,j=[f.slice(0,w),f.slice(w+u.length)],f=j[1],k=(x=j[0]).indexOf("\r\n\r\n"),S=p(x.slice(0,k)),(_=S["content-type"])&&-1===_.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(P=x.slice(k))if(E=d(e,P),Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E||"payload"in E)if(Object(l.a)(E)){if(T={},"payload"in E){if(1===Object.keys(E).length&&null===E.payload)return[2];T=Object(r.__assign)({},E.payload)}"errors"in E&&(T=Object(r.__assign)(Object(r.__assign)({},T),{extensions:Object(r.__assign)(Object(r.__assign)({},"extensions"in T?T.extensions:null),(C={},C[c.b]=E.errors,C))})),t(T)}else t(E);else if(1===Object.keys(E).length&&"hasNext"in E&&!E.hasNext)return[2];w=f.indexOf(u)}return[3,1];case 3:return[2]}}))}))}function p(e){var t={};return e.split("\n").forEach((function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}})),t}function d(e,t){if(e.status>=300){u(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(r){var n=r;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function m(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function v(e){return function(t){return t.text().then((function(e){return d(t,e)})).then((function(n){return Array.isArray(n)||f.call(n,"data")||f.call(n,"errors")||u(t,n,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),n}))}}},837:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(10),i=n(616);function o(e,t){return Object(i.a)(e,t,t.variables&&{variables:Object(i.a)(Object(r.__assign)(Object(r.__assign)({},e&&e.variables),t.variables))})}},838:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));let r=null;const i={};let o=1;function a(e){try{return e()}catch(e){}}const s="@wry/context:Slot",u=a((()=>globalThis))||a((()=>e))||Object.create(null),c=u[s]||Array[s]||function(e){try{Object.defineProperty(u,s,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",o++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=r;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===i)break;return e!==r&&(r.slots[this.id]=t),!0}return r&&(r.slots[this.id]=i),!1}getValue(){if(this.hasValue())return r.slots[this.id]}withValue(e,t,n,i){const o={__proto__:null,[this.id]:e},a=r;r={parent:a,slots:o};try{return t.apply(i,n)}finally{r=a}}static bind(e){const t=r;return function(){const n=r;try{return r=t,e.apply(this,arguments)}finally{r=n}}}static noContext(e,t,n){if(!r)return e.apply(n,t);{const i=r;try{return r=null,e.apply(n,t)}finally{r=i}}}})}).call(this,n(239))},839:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=Object.prototype.toString;function i(e){return o(e)}function o(e,t){switch(r.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=o(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var i=Object.create(Object.getPrototypeOf(e));return t.set(e,i),Object.keys(e).forEach((function(n){i[n]=o(e[n],t)})),i;default:return e}}},842:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(54),i=n(393),o=n(18),a=i.d?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function s(){Object(o.c)("createContext"in r,46);var e=r.createContext[a];return e||(Object.defineProperty(r.createContext,a,{value:e=r.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}},843:function(e,t,n){var r=n(945);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=h;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",l=t&&t.delimiter||"/";null!=(n=i.exec(e));){var f=n[0],h=n[1],p=n.index;if(s+=e.slice(a,p),a=p+f.length,h)s+=h[1];else{var d=e[a],m=n[2],v=n[3],g=n[4],y=n[5],b=n[6],O=n[7];s&&(r.push(s),s="");var w=null!=m&&null!=d&&d!==m,x="+"===b||"*"===b,k="?"===b||"*"===b,S=n[2]||l,_=g||y;r.push({name:v||o++,prefix:m||"",delimiter:S,optional:k,repeat:x,partial:w,asterisk:!!O,pattern:_?c(_):O?".*":"[^"+u(S)+"]+?"})}}return a":".","?":"/","|":"\\"},f={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},h=1;h<20;++h)u[111+h]="f"+h;for(h=0;h<=9;++h)u[h+96]=h.toString();b.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},b.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},b.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},b.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},b.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},b.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},b.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(u[t]=e[t]);s=null},b.init=function(){var e=b(o);for(var t in e)"_"!==t.charAt(0)&&(b[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},b.init(),i.Mousetrap=b,e.exports&&(e.exports=b),void 0===(r=function(){return b}.call(t,n,t,e))||(e.exports=r)}function p(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function d(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return u[e.which]?u[e.which]:c[e.which]?c[e.which]:String.fromCharCode(e.which).toLowerCase()}function m(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function v(e,t,n){return n||(n=function(){if(!s)for(var e in s={},u)e>95&&e<112||u.hasOwnProperty(e)&&(s[u[e]]=e);return s}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function g(e,t){var n,r,i,o=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),i=0;i1?h(e,s,n,r):(a=g(e,r),t._callbacks[a.key]=t._callbacks[a.key]||[],c(a.key,a.modifiers,{type:a.action},i,e,o),t._callbacks[a.key][i?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:i,level:o,combo:e}))}t._handleKey=function(e,t,n){var r,i=c(e,t,n),o={},f=0,h=!1;for(r=0;re}},a="undefined"!=typeof WeakMap?WeakMap:Map,s="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:r,unregister:r}};class u{constructor(e=1/0,t=i){this.max=e,this.dispose=t,this.map=new a,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new o(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new s(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}},864:function(e,t,n){"use strict";e.exports=n(918)},871:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(151);function i(e){var t=new Set([e]);return t.forEach((function(e){Object(r.a)(e)&&function(e){if(!1!==globalThis.__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(n){Object(r.a)(e[n])&&t.add(e[n])}))})),e}function o(e){return!1!==globalThis.__DEV__&&i(e),e}},872:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(54),i=n(393).b?r.useLayoutEffect:r.useEffect},873:function(e,t,n){"use strict";e.exports=n(946)},874:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(356),i=n(393),o=n(86),a=n(18),s=n(862),u=n(187),c=n(588);function l(e){return e}var f=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=i.f?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(l,{cache:!1})},e.split=function(t,n,r){return void 0===r&&(r=e.identity()),Object.assign(new e((function(e){return(t(e)?n:r).transformDocument(e)}),{cache:!1}),{left:n,right:r})},e.prototype.resetCache=function(){var t=this;if(this.cached){var n=new r.a(i.e);this.performWork=Object(u.c)(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return Object(a.c)(Array.isArray(r),69),n.lookupArray(r)},max:c.a["documentTransform.cache"],cache:s.a})}},e.prototype.performWork=function(e){return Object(o.a)(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var n=this;return Object.assign(new e((function(e){return t.transformDocument(n.transformDocument(e))}),{cache:!1}),{left:this,right:t})},e}()},875:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(571);function i(e,t,n){return new r.a((function(r){var i={then:function(e){return new Promise((function(t){return t(e())}))}};function o(e,t){return function(n){if(e){var o=function(){return r.closed?0:e(n)};i=i.then(o,o).then((function(e){return r.next(e)}),(function(e){return r.error(e)}))}else r[t](n)}}var a={next:o(t,"next"),error:o(n,"error"),complete:function(){i.then((function(){return r.complete()}))}},s=e.subscribe(a);return function(){return s.unsubscribe()}}))}},876:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),i=n(571),o=n(577),a=n(786);function s(e){return e&&"function"==typeof e.then}var u=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],n.notify("next",e),Object(o.a)(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),n.notify("error",e),Object(o.a)(n.observers,"error",e))},complete:function(){var e=n,t=e.sub,r=e.sources;if(null!==t){var i=(void 0===r?[]:r).shift();i?s(i)?i.then((function(e){return n.sub=e.subscribe(n.handlers)}),n.handlers.error):n.sub=i.subscribe(n.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Object(o.a)(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.error(e)},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new i.a(t)]),s(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return Object(r.__extends)(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach((function(n){return n(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(n,r){t||(t=!0,e(n,r))}))},t}(i.a);Object(a.a)(u)},877:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(354),i=n(489);function o(e){var t=a(e);return Object(r.b)(t)}function a(e){var t=Object(r.b)(e.errors)?e.errors.slice(0):[];return Object(i.b)(e)&&Object(r.b)(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}},878:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=n(166).a.execute},884:function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function b(e,t){if(e){if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";w(this,e),this.data=t,this.name=i,o.g.prototype.hasOwnProperty("tree")||Object.defineProperty(o.g.prototype,"tree",{get:function(){return A(this)}}),this.parser=n,this.extension=[q.of(this),o.g.languageData.of((function(e,t,n){var r=j(e,t,n),i=r.type.prop(_);if(!i)return[];var o=e.facet(i),a=r.type.prop(E);if(a){var s,u=r.resolve(t-r.from,n),c=y(a);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(l.test(u,e)){var f=e.facet(l.facet);return"replace"==l.type?f:f.concat(o)}}}catch(e){c.e(e)}finally{c.f()}}return o}))].concat(r)}return k(e,[{key:"isActiveAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return j(e,t,n).type.prop(_)==this.data}},{key:"findRegions",value:function(e){var t=this,n=e.facet(q);if((null==n?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return function e(n,o){if(n.prop(_)!=t.data){var a=n.prop(i.c.mounted);if(a){if(a.tree.prop(_)==t.data){if(a.overlay){var s,u=y(a.overlay);try{for(u.s();!(s=u.n()).done;){var c=s.value;r.push({from:c.from+o,to:c.to+o})}}catch(e){u.e(e)}finally{u.f()}}else r.push({from:o,to:o+n.length});return}if(a.overlay){var l=r.length;if(e(a.tree,a.overlay[0].from+o),r.length>l)return}}for(var f=0;f2&&void 0!==arguments[2]?arguments[2]:50,i=null===(n=e.field(T.state,!1))||void 0===n?void 0:n.context;if(!i)return null;var o=i.viewport;i.updateViewport({from:0,to:t});var a=i.isDone(t)||i.work(r,t)?i.tree:null;return i.updateViewport(o),a}var $=function(){function e(t){w(this,e),this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}return k(e,[{key:"length",get:function(){return this.doc.length}},{key:"syncTo",value:function(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}},{key:"chunk",value:function(e){return this.syncTo(e),this.string}},{key:"lineChunks",get:function(){return!0}},{key:"read",value:function(e,t){var n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}]),e}(),Q=null,I=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0;w(this,e),this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=a,this.skipped=s,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}return k(e,[{key:"startParse",value:function(){return this.parser.startParse(new $(this.state.doc),this.fragments)}},{key:"work",value:function(e,t){var n=this;return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=i.h.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((function(){var r;if("number"==typeof e){var o=Date.now()+e;e=function(){return Date.now()>o}}for(n.parse||(n.parse=n.startParse()),null!=t&&(null==n.parse.stoppedAt||n.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((function(){for(;!(t=n.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(i.i.addTree(this.tree,this.fragments,!0)),this.parse=null)}},{key:"withContext",value:function(e){var t=Q;Q=this;try{return e()}finally{Q=t}}},{key:"withoutTempSkipped",value:function(e){for(var t;t=this.tempSkipped.pop();)e=M(e,t.from,t.to);return e}},{key:"changes",value:function(t,n){var r=this.fragments,o=this.tree,a=this.treeLen,s=this.viewport,u=this.skipped;if(this.takeTree(),!t.empty){var c=[];if(t.iterChangedRanges((function(e,t,n,r){return c.push({fromA:e,toA:t,fromB:n,toB:r})})),r=i.i.applyChanges(r,c),o=i.h.empty,a=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){u=[];var l,f=y(this.skipped);try{for(f.s();!(l=f.n()).done;){var h=l.value,p=t.mapPos(h.from,1),d=t.mapPos(h.to,-1);pe.from&&(this.fragments=M(this.fragments,i,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}},{key:"reset",value:function(){this.parse&&(this.takeTree(),this.parse=null)}},{key:"skipUntilInView",value:function(e,t){this.skipped.push({from:e,to:t})}},{key:"isDone",value:function(e){e=Math.min(e,this.state.doc.length);var t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}}],[{key:"create",value:function(t,n,r){return new e(t,n,[],i.h.empty,0,r,[],null)}},{key:"getSkippingParser",value:function(e){return new(function(t){function n(){return w(this,n),f(this,n,arguments)}return m(n,t),k(n,[{key:"createParse",value:function(t,n,r){var o=r[0].from,a=r[r.length-1].to;return{parsedPos:o,advance:function(){var t=Q;if(t){var n,s=y(r);try{for(s.s();!(n=s.n()).done;){var u=n.value;t.tempSkipped.push(u)}}catch(e){s.e(e)}finally{s.f()}e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new i.h(i.e.none,[],[],a-o)},stoppedAt:null,stopAt:function(){}}}}]),n}(i.g))}},{key:"get",value:function(){return Q}}]),e}();function M(e,t,n){return i.i.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var D=function(){function e(t){w(this,e),this.context=t,this.tree=t.tree}return k(e,[{key:"apply",value:function(t){if(!t.docChanged&&this.tree==this.context.tree)return this;var n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}}],[{key:"init",value:function(t){var n=Math.min(3e3,t.doc.length),r=I.create(t.facet(q).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}}]),e}();T.state=o.o.define({create:D.init,update:function(e,t){var n,r=y(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(T.setState))return i.value}}catch(e){r.e(e)}finally{r.f()}return t.startState.facet(q)!=t.state.facet(q)?D.init(t.state):e.apply(t)}});var N=function(e){var t=setTimeout((function(){return e()}),500);return function(){return clearTimeout(t)}};"undefined"!=typeof requestIdleCallback&&(N=function(e){var t=-1,n=setTimeout((function(){t=requestIdleCallback(e,{timeout:400})}),100);return function(){return t<0?clearTimeout(n):cancelIdleCallback(t)}});var F="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?function(){return navigator.scheduling.isInputPending()}:null,L=a.e.fromClass(function(){function e(t){w(this,e),this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return k(e,[{key:"update",value:function(e){var t=this.view.state.field(T.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}},{key:"scheduleWork",value:function(){if(!this.working){var e=this.view.state,t=e.field(T.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=N(this.work))}}},{key:"work",value:function(e){this.working=null;var t=Date.now();if(this.chunkEndi+1e3,u=o.context.work((function(){return F&&F()||Date.now()>a}),i+(s?0:1e5));this.chunkBudget-=Date.now()-t,(u||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:T.setState.of(new D(o.context))})),this.chunkBudget>0&&(!u||s)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}}}},{key:"checkAsyncSchedule",value:function(e){var t=this;e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((function(){return t.scheduleWork()})).catch((function(e){return Object(a.s)(t.view.state,e)})).then((function(){return t.workScheduled--})),e.scheduleOn=null)}},{key:"destroy",value:function(){this.working&&this.working()}},{key:"isWorking",value:function(){return!!(this.working||this.workScheduled>0)}}]),e}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),q=o.h.define({combine:function(e){return e.length?e[0]:null},enables:function(e){return[T.state,L,a.c.contentAttributes.compute([e],(function(t){var n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]}}),z=k((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];w(this,e),this.language=t,this.support=n,this.extension=[t,n]})),U=function(){function e(t,n,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0;w(this,e),this.name=t,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=o,this.support=a,this.loading=null}return k(e,[{key:"load",value:function(){var e=this;return this.loading||(this.loading=this.loadFunc().then((function(t){return e.support=t}),(function(t){throw e.loading=null,t})))}}],[{key:"of",value:function(t){var n=t.load,r=t.support;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=function(){return Promise.resolve(r)}}return new e(t.name,(t.alias||[]).concat(t.name).map((function(e){return e.toLowerCase()})),t.extensions||[],t.filename,n,r)}},{key:"matchFilename",value:function(e,t){var n,r=y(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.filename&&i.filename.test(t))return i}}catch(e){r.e(e)}finally{r.f()}var o=/\.([^.]+)$/.exec(t);if(o){var a,s=y(e);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(u.extensions.indexOf(o[1])>-1)return u}}catch(e){s.e(e)}finally{s.f()}}return null}},{key:"matchLanguageName",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=t.toLowerCase();var r,i=y(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.alias.some((function(e){return e==t})))return o}}catch(e){i.e(e)}finally{i.f()}if(n){var a,s=y(e);try{for(s.s();!(a=s.n()).done;){var u,c=a.value,l=y(c.alias);try{for(l.s();!(u=l.n()).done;){var f=u.value,h=t.indexOf(f);if(h>-1&&(f.length>2||!/\w/.test(t[h-1])&&!/\w/.test(t[h+f.length])))return c}}catch(e){l.e(e)}finally{l.f()}}}catch(e){s.e(e)}finally{s.f()}}return null}}]),e}(),B=o.h.define(),Z=o.h.define({combine:function(e){if(!e.length)return" ";var t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((function(e){return e!=t[0]})))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function V(e){var t=e.facet(Z);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function W(e,t){var n="",r=e.tabSize,i=e.facet(Z)[0];if("\t"==i){for(;t>=r;)n+="\t",t-=r;i=" "}for(var o=0;o=t?function(e,t,n){var r=t.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){for(var o=[],a=i;a!=r.node;a=a.parent)o.push(a);for(var s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return H(r,e,n)}(e,a,t):null}var Y=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,e),this.state=t,this.options=n,this.unit=V(t)}return k(e,[{key:"lineAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.state.doc.lineAt(e),r=this.options,i=r.simulateBreak,o=r.simulateDoubleBreak;return null!=i&&i>=n.from&&i<=n.to?o&&i==e?{text:"",from:e}:(t<0?i1&&void 0!==arguments[1]?arguments[1]:1;if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";var n=this.lineAt(e,t),r=n.text,i=n.from;return r.slice(e-i,Math.min(r.length,e+100-i))}},{key:"column",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}},{key:"countColumn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return Object(o.u)(e,this.state.tabSize,t)}},{key:"lineIndent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.options.overrideIndentation;if(o){var a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}},{key:"simulatedBreak",get:function(){return this.options.simulateBreak||null}}]),e}(),G=new i.c;function H(e,t,n){for(var r=e;r;r=r.next){var i=K(r.node);if(i)return i(ee.create(t,n,r))}return 0}function K(e){var t=e.type.prop(G);if(t)return t;var n,r=e.firstChild;if(r&&(n=r.type.prop(i.c.closedBy))){var o=e.lastChild,a=o&&n.indexOf(o.name)>-1;return function(e){return re(e,!0,1,void 0,a&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?o.from:void 0)}}return null==e.parent?J:null}function J(){return 0}var ee=function(e){function t(e,n,r){var i;return w(this,t),(i=f(this,t,[e.state,e.options])).base=e,i.pos=n,i.context=r,i}return m(t,e),k(t,[{key:"node",get:function(){return this.context.node}},{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){return this.baseIndentFor(this.node)}},{key:"baseIndentFor",value:function(e){for(var t=this.state.doc.lineAt(e.from);;){for(var n=e.resolve(t.from);n.parent&&n.parent.from==n.from;)n=n.parent;if(te(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}},{key:"continue",value:function(){return H(this.context.next,this.base,this.pos)}}],[{key:"create",value:function(e,n,r){return new t(e,n,r)}}]),t}(Y);function te(e,t){for(var n=t;n;n=n.parent)if(e==n)return!0;return!1}function ne(e){var t=e.closing,n=e.align,r=void 0===n||n,i=e.units,o=void 0===i?1:i;return function(e){return re(e,r,o,t)}}function re(e,t,n,r,i){var o=e.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==e.pos+a,u=t?function(e){var t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;for(var i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==i||i<=o.from?o.to:Math.min(o.to,i),s=n.to;;){var u=t.childAfter(s);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=a)return null;var c=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+c}}s=u.to}}(e):null;return u?s?e.column(u.from):e.column(u.to):e.baseIndent+(s?0:e.unit*n)}var ie=function(e){return e.baseIndent};function oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.except,n=e.units,r=void 0===n?1:n;return function(e){var n=t&&t.test(e.textAfter);return e.baseIndent+(n?0:r*e.unit)}}function ae(){return o.g.transactionFilter.of((function(e){if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;var t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;var n=e.newDoc,r=e.newSelection.main.head,i=n.lineAt(r);if(r>i.from+200)return e;var o=n.sliceString(i.from,r);if(!t.some((function(e){return e.test(o)})))return e;var a,s=e.state,u=-1,c=[],l=y(s.selection.ranges);try{for(l.s();!(a=l.n()).done;){var f=a.value.head,h=s.doc.lineAt(f);if(h.from!=u){u=h.from;var p=X(s,h.from);if(null!=p){var d=/^\s*/.exec(h.text)[0],m=W(s,p);d!=m&&c.push({from:h.from,to:h.from+d.length,insert:m})}}}}catch(e){l.e(e)}finally{l.f()}return c.length?[e,{changes:c,sequential:!0}]:e}))}var se=o.h.define(),ue=new i.c;function ce(e){var t=e.firstChild,n=e.lastChild;return t&&t.ton)){if(a&&u.from=t&&l.to>n&&(a=l)}}}return a}(e,t,n)}function fe(e,t){var n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var he=o.n.define({map:fe}),pe=o.n.define({map:fe});function de(e){var t,n=[],r=y(e.state.selection.ranges);try{var i=function(){var r=t.value.head;if(n.some((function(e){return e.from<=r&&e.to>=r})))return 1;n.push(e.lineBlockAt(r))};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}return n}var me=o.o.define({create:function(){return a.a.none},update:function(e,t){e=e.map(t.changes);var n,r=y(t.effects);try{var i=function(){var r=n.value;if(r.is(he)&&!function(e,t,n){var r=!1;return e.between(t,t,(function(e,i){e==t&&i==n&&(r=!0)})),r}(e,r.value.from,r.value.to)){var i=t.state.facet(xe).preparePlaceholder,o=i?a.a.replace({widget:new Pe(i(t.state,r.value))}):_e;e=e.update({add:[o.range(r.value.from,r.value.to)]})}else r.is(pe)&&(e=e.update({filter:function(e,t){return r.value.from!=e||r.value.to!=t},filterFrom:r.value.from,filterTo:r.value.to}))};for(r.s();!(n=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}if(t.selection){var o=!1,s=t.selection.main.head;e.between(s,s,(function(e,t){es&&(o=!0)})),o&&(e=e.update({filterFrom:s,filterTo:s,filter:function(e,t){return t<=s||e>=s}}))}return e},provide:function(e){return a.c.decorations.from(e)},toJSON:function(e,t){var n=[];return e.between(0,t.doc.length,(function(e,t){n.push(e,t)})),n},fromJSON:function(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");for(var t=[],n=0;ne)&&(i={from:e,to:t})})),i}function ge(e,t){return e.field(me,!1)?t:t.concat(o.n.appendConfig.of(ke()))}var ye=function(e){var t,n=y(de(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=le(e.state,r.from,r.to);if(i)return e.dispatch({effects:ge(e.state,[he.of(i),be(e,i)])}),!0}}catch(e){n.e(e)}finally{n.f()}return!1};function be(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return a.c.announce.of("".concat(e.state.phrase(n?"Folded lines":"Unfolded lines")," ").concat(r," ").concat(e.state.phrase("to")," ").concat(i,"."))}var Oe=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ye},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(me,!1))return!1;var t,n=[],r=y(de(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=ve(e.state,i.from,i.to);o&&n.push(pe.of(o),be(e,o,!1))}}catch(e){r.e(e)}finally{r.f()}return n.length&&e.dispatch({effects:n}),n.length>0}},{key:"Ctrl-Alt-[",run:function(e){for(var t=e.state,n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},Ee),e),n=new Te(t,!0),r=new Te(t,!1),i=a.e.fromClass(function(){function e(t){w(this,e),this.from=t.viewport.from,this.markers=this.buildMarkers(t)}return k(e,[{key:"update",value:function(e){(e.docChanged||e.viewportChanged||e.startState.facet(q)!=e.state.facet(q)||e.startState.field(me,!1)!=e.state.field(me,!1)||A(e.startState)!=A(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}},{key:"buildMarkers",value:function(e){var t,i=new o.l,a=y(e.viewportLineBlocks);try{for(a.s();!(t=a.n()).done;){var s=t.value,u=ve(e.state,s.from,s.to)?r:le(e.state,s.from,s.to)?n:null;u&&i.add(s.from,s.from,u)}}catch(e){a.e(e)}finally{a.f()}return i.finish()}}]),e}()),s=t.domEventHandlers;return[i,Object(a.m)({class:"cm-foldGutter",markers:function(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.markers)||o.k.empty},initialSpacer:function(){return new Te(t,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:function(e,t,n){if(s.click&&s.click(e,t,n))return!0;var r=ve(e.state,t.from,t.to);if(r)return e.dispatch({effects:pe.of(r)}),!0;var i=le(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:he.of(i)}),!0)}})}),ke()]}var Ce=a.c.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),Ae=function(){function e(t,n){var r;function i(e){var t=u.a.newName();return(r||(r=Object.create(null)))["."+t]=e,t}w(this,e),this.specs=t;var o="string"==typeof n.all?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof T?function(e){return e.prop(_)==a.data}:a?function(e){return e==a}:void 0,this.style=Object(s.d)(t.map((function(e){return{tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))}})),{all:o}).style,this.module=r?new u.a(r):null,this.themeType=n.themeType}return k(e,null,[{key:"define",value:function(t,n){return new e(t,n||{})}}]),e}(),Re=o.h.define(),$e=o.h.define({combine:function(e){return e.length?[e[0]]:null}});function Qe(e){var t=e.facet(Re);return t.length?t:e.facet($e)}function Ie(e,t){var n,r=[De];return e instanceof Ae&&(e.module&&r.push(a.c.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push($e.of(e)):n?r.push(Re.computeN([a.c.darkTheme],(function(t){return t.facet(a.c.darkTheme)==("dark"==n)?[e]:[]}))):r.push(Re.of(e)),r}var Me=function(){function e(t){w(this,e),this.markCache=Object.create(null),this.tree=A(t.state),this.decorations=this.buildDeco(t,Qe(t.state)),this.decoratedTo=t.viewport.to}return k(e,[{key:"update",value:function(e){var t=A(e.state),n=Qe(e.state),r=n!=Qe(e.startState),i=e.view.viewport,o=e.changes.mapPos(this.decoratedTo,1);t.length=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}},{key:"buildDeco",value:function(e,t){var n=this;if(!t||!this.tree.length)return a.a.none;var r,i=new o.l,u=y(e.visibleRanges);try{for(u.s();!(r=u.n()).done;){var c=r.value,l=c.from,f=c.to;Object(s.b)(this.tree,t,(function(e,t,r){i.add(e,t,n.markCache[r]||(n.markCache[r]=a.a.mark({class:r})))}),l,f)}}catch(e){u.e(e)}finally{u.f()}return i.finish()}}]),e}(),De=o.j.high(a.e.fromClass(Me,{decorations:function(e){return e.decorations}})),Ne=Ae.define([{tag:s.e.meta,color:"#404740"},{tag:s.e.link,textDecoration:"underline"},{tag:s.e.heading,textDecoration:"underline",fontWeight:"bold"},{tag:s.e.emphasis,fontStyle:"italic"},{tag:s.e.strong,fontWeight:"bold"},{tag:s.e.strikethrough,textDecoration:"line-through"},{tag:s.e.keyword,color:"#708"},{tag:[s.e.atom,s.e.bool,s.e.url,s.e.contentSeparator,s.e.labelName],color:"#219"},{tag:[s.e.literal,s.e.inserted],color:"#164"},{tag:[s.e.string,s.e.deleted],color:"#a11"},{tag:[s.e.regexp,s.e.escape,s.e.special(s.e.string)],color:"#e40"},{tag:s.e.definition(s.e.variableName),color:"#00f"},{tag:s.e.local(s.e.variableName),color:"#30a"},{tag:[s.e.typeName,s.e.namespace],color:"#085"},{tag:s.e.className,color:"#167"},{tag:[s.e.special(s.e.variableName),s.e.macroName],color:"#256"},{tag:s.e.definition(s.e.propertyName),color:"#00c"},{tag:s.e.comment,color:"#940"},{tag:s.e.invalid,color:"#f00"}]),Fe=a.c.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Le=1e4,qe="()[]{}",ze=o.h.define({combine:function(e){return Object(o.t)(e,{afterCursor:!0,brackets:qe,maxScanDistance:Le,renderMatch:Ze})}}),Ue=a.a.mark({class:"cm-matchingBracket"}),Be=a.a.mark({class:"cm-nonmatchingBracket"});function Ze(e){var t=[],n=e.matched?Ue:Be;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}var Ve=[o.o.define({create:function(){return a.a.none},update:function(e,t){if(!t.docChanged&&!t.selection)return e;var n,r=[],i=t.state.facet(ze),o=y(t.state.selection.ranges);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(s.empty){var u=He(t.state,s.head,-1,i)||s.head>0&&He(t.state,s.head-1,1,i)||i.afterCursor&&(He(t.state,s.head,1,i)||s.head0&&void 0!==arguments[0]?arguments[0]:{};return[ze.of(e),Ve]}var Xe=new i.c;function Ye(e,t,n){var r=e.prop(t<0?i.c.openedBy:i.c.closedBy);if(r)return r;if(1==e.name.length){var o=n.indexOf(e.name);if(o>-1&&o%2==(t<0?1:0))return[n[o+t]]}return null}function Ge(e){var t=e.type.prop(Xe);return t?t(e.node):e}function He(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.maxScanDistance||Le,o=r.brackets||qe,a=A(e),s=a.resolveInner(t,n),u=s;u;u=u.parent){var c=Ye(u.type,n,o);if(c&&u.from0?t>=l.from&&tl.from&&t<=l.to))return Ke(e,t,n,u,l,c,o)}}return Je(e,t,n,a,s.type,i,o)}function Ke(e,t,n,r,i,o,a){var s=r.parent,u={from:i.from,to:i.to},c=0,l=null==s?void 0:s.cursor();if(l&&(n<0?l.childBefore(r.from):l.childAfter(r.to)))do{if(n<0?l.to<=r.from:l.from>=r.to){if(0==c&&o.indexOf(l.type.name)>-1&&l.from0)return null;for(var c={from:n<0?t-1:t,to:n>0?t+1:t},l=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,h=0;!l.next().done&&h<=o;){var p=l.value;n<0&&(h+=p.length);for(var d=t+h*n,m=n>0?0:p.length-1,v=n>0?p.length:-1;m!=v;m+=n){var g=a.indexOf(p[m]);if(!(g<0||r.resolveInner(d+m,1).type!=i))if(g%2==0==n>0)f++;else{if(1==f)return{start:c,end:{from:d+m,to:d+m+1},matched:g>>1==u>>1};f--}}n>0&&(h+=p.length)}return l.done?{start:c,matched:!1}:null}function et(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i,a=r;a=this.string.length}},{key:"sol",value:function(){return 0==this.pos}},{key:"peek",value:function(){return this.string.charAt(this.pos)||void 0}},{key:"next",value:function(){if(this.post}},{key:"eatSpace",value:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}},{key:"skipToEnd",value:function(){this.pos=this.string.length}},{key:"skipTo",value:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}},{key:"backUp",value:function(e){this.pos-=e}},{key:"column",value:function(){return this.lastColumnPos0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}},{key:"current",value:function(){return this.string.slice(this.start,this.pos)}}]),e}();function nt(e){if("object"!=g(e))return e;var t={};for(var n in e){var r=e[n];t[n]=r instanceof Array?r.slice():r}return t}var rt=new WeakMap,it=function(e){function t(e){var n;w(this,t);var r,o,a=P(e.languageData),s={name:(o=e).name||"",token:o.token,blankLine:o.blankLine||function(){},startState:o.startState||function(){return!0},copyState:o.copyState||nt,indent:o.indent||function(){return null},languageData:o.languageData||{},tokenTable:o.tokenTable||ct},u=new(function(e){function t(){return w(this,t),f(this,t,arguments)}return m(t,e),k(t,[{key:"createParse",value:function(e,t,n){return new st(r,e,t,n)}}]),t}(i.g));return(n=f(this,t,[a,u,[B.of((function(e,t){return n.getIndent(e,t)}))],e.name])).topNode=function(e){var t=i.e.define({id:lt.length,name:"Document",props:[_.add((function(){return e}))],top:!0});return lt.push(t),t}(a),r=h(n),n.streamParser=s,n.stateAfter=new i.c({perNode:!0}),n.tokenTable=e.tokenTable?new Ot(s.tokenTable):wt,n}return m(t,e),k(t,[{key:"getIndent",value:function(e,t){for(var n=A(e.state),r=n.resolve(t);r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;var i=void 0,o=e.options.overrideIndentation;o&&null!=(i=rt.get(e.state))&&i1e4)return null;for(;a=r&&n+t.length<=o&&t.prop(e.stateAfter);if(a)return{state:e.streamParser.copyState(a),pos:n+t.length};for(var s=t.children.length-1;s>=0;s--){var u=t.children[s],c=n+t.positions[s],l=u instanceof i.h&&c=t.length)return t;o||t.type!=e.topNode||(o=!0);for(var a=t.children.length-1;a>=0;a--){var s=t.positions[a],u=t.children[a],c=void 0;if(sn&&ot(e,s.tree,0-s.offset,n,c),f=void 0;if(l&&(f=at(e,s.tree,n+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:f}}}catch(e){a.e(e)}finally{a.f()}return{state:e.streamParser.startState(r?V(r):4),tree:i.h.empty}}(t,r,s,null==a?void 0:a.state),c=u.state,l=u.tree;this.state=c,this.parsedPos=this.chunkStart=s+l.length;for(var f=0;f=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}},{key:"stopAt",value:function(e){this.stoppedAt=e}},{key:"lineAfter",value:function(e){var t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{var n=t.indexOf("\n");n>-1&&(t=t.slice(0,n))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}},{key:"nextLine",value:function(){for(var e=this.parsedPos,t=this.lineAfter(e),n=e+t.length,r=this.rangeIndex;;){var i=this.ranges[r].to;if(i>=n)break;if(t=t.slice(0,i-(n-t.length)),++r==this.ranges.length)break;var o=this.ranges[r].from,a=this.lineAfter(o);t+=a,n=o+a.length}return{line:t,end:n}}},{key:"skipGapsTo",value:function(e,t,n){for(;;){var r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;t+=this.ranges[++this.rangeIndex].from-r}return t}},{key:"moveRangeIndex",value:function(){for(;this.ranges[this.rangeIndex].to1){t+=i=this.skipGapsTo(t,i,1);var o=this.chunk.length;n+=i=this.skipGapsTo(n,i,-1),r+=this.chunk.length-o}return this.chunk.push(e,t,n,r),i}},{key:"parseLine",value:function(e){var t=this.nextLine(),n=t.line,r=t.end,i=0,o=this.lang.streamParser,a=new tt(n,e?e.state.tabSize:4,e?V(e.state):2);if(a.eol())o.blankLine(this.state,a.indentUnit);else for(;!a.eol();){var s=ut(o.token,a,this.state);if(s&&(i=this.emitToken(this.lang.tokenTable.resolve(s),this.parsedPos+a.start,this.parsedPos+a.pos,4,i)),a.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPost.start)return i}throw new Error("Stream parser failed to advance stream.")}for(var ct=Object.create(null),lt=[i.e.none],ft=new i.d(lt),ht=[],pt=Object.create(null),dt=Object.create(null),mt=0,vt=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];mt-1||(ht.push(e),console.warn(t))}function kt(e,t){var n,r=[],o=y(t.split(" "));try{for(o.s();!(n=o.n()).done;){var a,u=n.value,l=[],f=y(u.split("."));try{for(f.s();!(a=f.n()).done;){var h=a.value,p=e[h]||s.e[h];p?"function"==typeof p?l.length?l=l.map(p):xt(h,"Modifier ".concat(h," used at start of tag")):l.length?xt(h,"Tag ".concat(h," used as modifier")):l=Array.isArray(p)?p:[p]:xt(h,"Unknown highlighting tag ".concat(h))}}catch(e){f.e(e)}finally{f.f()}var d,m=y(l);try{for(m.s();!(d=m.n()).done;){var v=d.value;r.push(v)}}catch(e){m.e(e)}finally{m.f()}}}catch(e){o.e(e)}finally{o.f()}if(!r.length)return 0;var g=t.replace(/ /g,"_"),b=g+" "+r.map((function(e){return e.id})),O=pt[b];if(O)return O.id;var w=pt[b]=i.e.define({id:lt.length,name:g,props:[Object(s.c)(c({},g,r))]});return lt.push(w),w.id}a.b.RTL,a.b.LTR},902:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a}));var r=n(57),i=n(37);const o=Object(i.b)();function a(e,t={}){if(!e)return"";try{let n=e;const r=5,i=[];let o=0,a=0;const u=" > ",c=u.length;let l;const f=Array.isArray(t)?t:t.keyAttrs,h=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&o++1&&a+i.length*c+l.length>=h));)i.push(l),a+=l.length,n=n.parentNode;return i.reverse().join(u)}catch(e){return""}}function s(e,t){const n=e,i=[];let a,s,u,c,l;if(!n||!n.tagName)return"";if(o.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;i.push(n.tagName.toLowerCase());const f=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(f&&f.length)f.forEach((e=>{i.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&i.push(`#${n.id}`),a=n.className,a&&Object(r.m)(a))for(s=a.split(/\s+/),l=0;l0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===r(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,s.default)(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new o.default({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return l("action",e)}},{key:"defaultTarget",value:function(e){var t=l("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return l("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}]),t}(a.default);function l(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}e.exports=c},function(e,t,n){"use strict";var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,s.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,s.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":i(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}();e.exports=u},function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(e),r.removeAllRanges(),r.addRange(i),t=r.toString()}return t}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r{n.handler===t&&this.bindings[e].splice(r,1)}))),this}trigger(e,...t){return!m(this.bindings)&&this.bindings[e]&&this.bindings[e].forEach(((n,r)=>{const{ctx:i,handler:o,once:a}=n,s=i||this;o.apply(s,t),a&&this.bindings[e].splice(r,1)})),this}}function g(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n{if(t.isOpen()){const r=t.el&&n.currentTarget===t.el;(!m(e)&&n.currentTarget.matches(e)||r)&&t.tour.next()}}}(n,e);let i;try{i=document.querySelector(n)}catch(e){}if(!m(n)&&!i)return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);i?(i.addEventListener(t,r),e.on("destroy",(()=>i.removeEventListener(t,r)))):(document.body.addEventListener(t,r,!0),e.on("destroy",(()=>document.body.removeEventListener(t,r,!0))))}}function b(e){return d(e)&&""!==e?"-"!==e.charAt(e.length-1)?`${e}-`:e:""}function O(e){return null==e||(!e.element||!e.on)}function w(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}const S=Math.min,_=Math.max,P=Math.round,E=Math.floor,T=e=>({x:e,y:e}),j={left:"right",right:"left",bottom:"top",top:"bottom"},C={start:"end",end:"start"};function A(e,t,n){return _(e,S(t,n))}function R(e,t){return"function"==typeof e?e(t):e}function $(e){return e.split("-")[0]}function Q(e){return e.split("-")[1]}function I(e){return"x"===e?"y":"x"}function M(e){return"y"===e?"height":"width"}function D(e){return["top","bottom"].includes($(e))?"y":"x"}function N(e){return I(D(e))}function F(e){return e.replace(/start|end/g,(e=>C[e]))}function L(e){return e.replace(/left|right|bottom|top/g,(e=>j[e]))}function q(e){return"number"!=typeof e?function(e){return x({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function z(e){return x({},e,{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}const U=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],B=["mainAxis","crossAxis","limiter"];function Z(e,t,n){let{reference:r,floating:i}=e;const o=D(t),a=N(t),s=M(a),u=$(t),c="y"===o,l=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let p;switch(u){case"top":p={x:l,y:r.y-i.height};break;case"bottom":p={x:l,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Q(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1)}return p}async function V(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=R(t,e),d=q(p),m=s[h?"floating"===f?"reference":"floating":f],v=z(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:l,strategy:u})),g="floating"===f?x({},a.floating,{x:r,y:i}):a.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},O=z(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-O.top+d.top)/b.y,bottom:(O.bottom-v.bottom+d.bottom)/b.y,left:(v.left-O.left+d.left)/b.x,right:(O.right-v.right+d.right)/b.x}}const W=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:u}=t,c=R(e,t),{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0}=c,v=k(c,U),g=$(r),y=$(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(u.floating)),O=h||(y||!m?[L(a)]:function(e){const t=L(e);return[F(e),t,F(t)]}(a));h||"none"===d||O.push(...function(e,t,n,r){const i=Q(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}($(e),"start"===n,r);return i&&(o=o.map((e=>e+"-"+i)),t&&(o=o.concat(o.map(F)))),o}(a,m,d,b));const w=[a,...O],x=await V(t,v),S=[];let _=(null==(n=i.flip)?void 0:n.overflows)||[];if(l&&S.push(x[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=Q(e),i=N(e),o=M(i);let a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=L(a)),[a,L(a)]}(r,o,b);S.push(x[e[0]],x[e[1]])}if(_=[..._,{placement:r,overflows:S}],!S.every((e=>e<=0))){var P,E;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(E=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!n)switch(p){case"bestFit":{var T;const e=null==(T=_.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},X=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=R(e,t),l={x:n,y:r},f=D(i),h=I(f);let p=l[h],d=l[f];const m=R(s,t),v="number"==typeof m?{mainAxis:m,crossAxis:0}:x({mainAxis:0,crossAxis:0},m);if(u){const e="y"===h?"height":"width",t=o.reference[h]-o.floating[e]+v.mainAxis,n=o.reference[h]+o.reference[e]-v.mainAxis;pn&&(p=n)}if(c){var g,y;const e="y"===h?"width":"height",t=["top","left"].includes($(i)),n=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),r=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);dr&&(d=r)}return{[h]:p,[f]:d}}}};function Y(e){return K(e)?(e.nodeName||"").toLowerCase():"#document"}function G(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function H(e){var t;return null==(t=(K(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function K(e){return e instanceof Node||e instanceof G(e).Node}function J(e){return e instanceof Element||e instanceof G(e).Element}function ee(e){return e instanceof HTMLElement||e instanceof G(e).HTMLElement}function te(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof G(e).ShadowRoot)}function ne(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=se(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function re(e){return["table","td","th"].includes(Y(e))}function ie(e){const t=oe(),n=se(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function oe(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ae(e){return["html","body","#document"].includes(Y(e))}function se(e){return G(e).getComputedStyle(e)}function ue(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ce(e){if("html"===Y(e))return e;const t=e.assignedSlot||e.parentNode||te(e)&&e.host||H(e);return te(t)?t.host:t}function le(e){const t=ce(e);return ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&ne(t)?t:le(t)}function fe(e,t){var n;void 0===t&&(t=[]);const r=le(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=G(r);return i?t.concat(o,o.visualViewport||[],ne(r)?r:[]):t.concat(r,fe(r))}function he(e){const t=se(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ee(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=P(n)!==o||P(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function pe(e){return J(e)?e:e.contextElement}function de(e){const t=pe(e);if(!ee(t))return T(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=he(t);let a=(o?P(n.width):n.width)/r,s=(o?P(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const me=T(0);function ve(e){const t=G(e);return oe()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:me}function ge(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=pe(e);let a=T(1);t&&(r?J(r)&&(a=de(r)):a=de(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==G(e))&&t}(o,n,r)?ve(o):T(0);let u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,l=i.width/a.x,f=i.height/a.y;if(o){const e=G(o),t=r&&J(r)?G(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=de(n),t=n.getBoundingClientRect(),r=se(n),i=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,l*=e.x,f*=e.y,u+=i,c+=o,n=G(n).frameElement}}return z({width:l,height:f,x:u,y:c})}function ye(e){return ge(H(e)).left+ue(e).scrollLeft}function be(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=G(e),r=H(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const e=oe();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}(e,n);else if("document"===t)r=function(e){const t=H(e),n=ue(e),r=e.ownerDocument.body,i=_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ye(e);const s=-n.scrollTop;return"rtl"===se(r).direction&&(a+=_(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}(H(e));else if(J(t))r=function(e,t){const n=ge(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ee(e)?de(e):T(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=ve(e);r=x({},t,{x:t.x-n.x,y:t.y-n.y})}return z(r)}function Oe(e,t){const n=ce(e);return!(n===t||!J(n)||ae(n))&&("fixed"===se(n).position||Oe(n,t))}function we(e,t,n){const r=ee(t),i=H(t),o="fixed"===n,a=ge(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=T(0);if(r||!r&&!o)if(("body"!==Y(t)||ne(i))&&(s=ue(t)),r){const e=ge(t,!0,o,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else i&&(u.x=ye(i));return{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function xe(e,t){return ee(e)&&"fixed"!==se(e).position?t?t(e):e.offsetParent:null}function ke(e,t){const n=G(e);if(!ee(e))return n;let r=xe(e,t);for(;r&&re(r)&&"static"===se(r).position;)r=xe(r,t);return r&&("html"===Y(r)||"body"===Y(r)&&"static"===se(r).position&&!ie(r))?n:r||function(e){let t=ce(e);for(;ee(t)&&!ae(t);){if(ie(t))return t;t=ce(t)}return null}(e)||n}const Se={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=ee(n),o=H(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s=T(1);const u=T(0);if((i||!i&&"fixed"!==r)&&(("body"!==Y(n)||ne(o))&&(a=ue(n)),ee(n))){const e=ge(n);s=de(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+u.x,y:t.y*s.y-a.scrollTop*s.y+u.y}},getDocumentElement:H,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=fe(e).filter((e=>J(e)&&"body"!==Y(e))),i=null;const o="fixed"===se(e).position;let a=o?ce(e):e;for(;J(a)&&!ae(a);){const t=se(a),n=ie(a);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||ne(a)&&!n&&Oe(e,a))?r=r.filter((e=>e!==a)):i=t,a=ce(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...o,r],s=a[0],u=a.reduce(((e,n)=>{const r=be(t,n,i);return e.top=_(r.top,e.top),e.right=S(r.right,e.right),e.bottom=S(r.bottom,e.bottom),e.left=_(r.left,e.left),e}),be(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:ke,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||ke,o=this.getDimensions;return{reference:we(t,await i(n),r),floating:x({x:0,y:0},await o(n))}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return he(e)},getScale:de,isElement:J,isRTL:function(e){return"rtl"===se(e).direction}};function _e(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,c=pe(e),l=i||o?[...c?fe(c):[],...fe(t)]:[];l.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const f=c&&s?function(e,t){let n,r=null;const i=H(e);function o(){clearTimeout(n),r&&r.disconnect(),r=null}return function a(s,u){void 0===s&&(s=!1),void 0===u&&(u=1),o();const{left:c,top:l,width:f,height:h}=e.getBoundingClientRect();if(s||t(),!f||!h)return;const p={rootMargin:-E(l)+"px "+-E(i.clientWidth-(c+f))+"px "+-E(i.clientHeight-(l+h))+"px "+-E(c)+"px",threshold:_(0,S(1,u))||1};let d=!0;function m(e){const t=e[0].intersectionRatio;if(t!==u){if(!d)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}d=!1}try{r=new IntersectionObserver(m,x({},p,{root:i.ownerDocument}))}catch(e){r=new IntersectionObserver(m,p)}r.observe(e)}(!0),o}(c,n):null;let h,p=-1,d=null;a&&(d=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{d&&d.observe(t)}))),n()})),c&&!u&&d.observe(c),d.observe(t));let m=u?ge(e):null;return u&&function t(){const r=ge(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{l.forEach((e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),f&&f(),d&&d.disconnect(),d=null,u&&cancelAnimationFrame(h)}}const Pe=(e,t,n)=>{const r=new Map,i=x({platform:Se},n),o=x({},i.platform,{_c:r});return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=Z(c,r,u),h=r,p={},d=0;for(let n=0;n{let{x:t,y:n}=e;return{x:t,y:n}}}}=o,c=k(o,B),l={x:n,y:r},f=await V(t,c),h=D($(i)),p=I(h);let d=l[p],m=l[h];if(a){const e="y"===p?"bottom":"right";d=A(d+f["y"===p?"top":"left"],d,d-f[e])}if(s){const e="y"===h?"bottom":"right";m=A(m+f["y"===h?"top":"left"],m,m-f[e])}const v=u.fn(x({},t,{[p]:d,[h]:m}));return x({},v,{data:{x:v.x-n,y:v.y-r}})}}}({limiter:X(),crossAxis:!0})),r&&n.middleware.push((e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s}=t,{element:u,padding:c=0}=R(e,t)||{};if(null==u)return{};const l=q(c),f={x:n,y:r},h=N(i),p=M(h),d=await a.getDimensions(u),m="y"===h,v=m?"top":"left",g=m?"bottom":"right",y=m?"clientHeight":"clientWidth",b=o.reference[p]+o.reference[h]-f[h]-o.floating[p],O=f[h]-o.reference[h],w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let x=w?w[y]:0;x&&await(null==a.isElement?void 0:a.isElement(w))||(x=s.floating[y]||o.floating[p]);const k=b/2-O/2,_=x/2-d[p]/2-1,P=S(l[v],_),E=S(l[g],_),T=P,j=x-d[p]-E,C=x/2-d[p]/2+k,$=A(T,C,j),I=null!=Q(i)&&C!=$&&o.reference[p]/2-(C{e.el?function(e,t,n,r){Pe(e,t.el,n).then(function(e,t){return({x:n,y:r,placement:i,middlewareData:o})=>e.el?(t?Object.assign(e.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(e.el.style,{position:"absolute",left:`${n}px`,top:`${r}px`}),e.el.dataset.popperPlacement=i,function(e,t){const n=e.querySelector(".shepherd-arrow");if(n&&t.arrow){const{x:e,y:r}=t.arrow;Object.assign(n.style,{left:null!=e?`${e}px`:"",top:null!=r?`${r}px`:""})}}(e.el,o),e):e}(t,r)).then((e=>new Promise((t=>{setTimeout((()=>t(e)),300)})))).then((e=>{e&&e.el&&e.el.focus({preventScroll:!0})}))}(n,e,r,i):e.cleanup()})),e.target=t.element,r}function Te(){}function je(e,t){for(const n in t)e[n]=t[n];return e}function Ce(e){return e()}function Ae(){return Object.create(null)}function Re(e){e.forEach(Ce)}function $e(e){return"function"==typeof e}function Qe(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function Ie(e,t){e.appendChild(t)}function Me(e,t,n){e.insertBefore(t,n||null)}function De(e){e.parentNode&&e.parentNode.removeChild(e)}function Ne(e){return document.createElement(e)}function Fe(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Le(e){return document.createTextNode(e)}function qe(){return Le(" ")}function ze(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ue(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const Be=["width","height"];function Ze(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const r in t)null==t[r]?e.removeAttribute(r):"style"===r?e.style.cssText=t[r]:"__value"===r?e.value=e[r]=t[r]:n[r]&&n[r].set&&-1===Be.indexOf(r)?e[r]=t[r]:Ue(e,r,t[r])}function Ve(e,t,n){e.classList[n?"add":"remove"](t)}let We;function Xe(e){We=e}function Ye(){if(!We)throw new Error("Function called outside component initialization");return We}function Ge(e){Ye().$$.after_update.push(e)}const He=[],Ke=[];let Je=[];const et=[],tt=Promise.resolve();let nt=!1;function rt(e){Je.push(e)}const it=new Set;let ot=0;function at(){if(0!==ot)return;const e=We;do{try{for(;ot{ut.delete(e),r&&(n&&e.d(1),r())})),e.o(t)}else r&&r()}function dt(e){e&&e.c()}function mt(e,t,n,r){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,n),r||rt((()=>{const t=e.$$.on_mount.map(Ce).filter($e);e.$$.on_destroy?e.$$.on_destroy.push(...t):Re(t),e.$$.on_mount=[]})),o.forEach(rt)}function vt(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];Je.forEach((r=>-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),Je=t}(n.after_update),Re(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function gt(e,t){-1===e.$$.dirty[0]&&(He.push(e),nt||(nt=!0,tt.then(at)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const o=r.length?r[0]:n;return c.ctx&&i(c.ctx[t],c.ctx[t]=o)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](o),l&>(e,t)),n})):[],c.update(),l=!0,Re(c.before_update),c.fragment=!!r&&r(c.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);c.fragment&&c.fragment.l(e),e.forEach(De)}else c.fragment&&c.fragment.c();t.intro&&ht(e.$$.fragment),mt(e,t.target,t.anchor,t.customElement),at()}Xe(u)}class bt{$destroy(){vt(this,1),this.$destroy=Te}$on(e,t){if(!$e(t))return Te;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Ot(e){let t,n,r,i,o;return{c(){t=Ne("button"),Ue(t,"aria-label",n=e[3]?e[3]:null),Ue(t,"class",r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],Ue(t,"tabindex","0")},m(n,r){Me(n,t,r),t.innerHTML=e[5],i||(o=ze(t,"click",(function(){$e(e[0])&&e[0].apply(this,arguments)})),i=!0)},p(i,[o]){e=i,32&o&&(t.innerHTML=e[5]),8&o&&n!==(n=e[3]?e[3]:null)&&Ue(t,"aria-label",n),18&o&&r!==(r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&Ue(t,"class",r),4&o&&(t.disabled=e[2])},i:Te,o:Te,d(e){e&&De(t),i=!1,o()}}}function wt(e,t,n){let r,i,o,a,s,u,{config:c,step:l}=t;function f(e){return p(e)?e.call(l):e}return e.$$set=e=>{"config"in e&&n(6,c=e.config),"step"in e&&n(7,l=e.step)},e.$$.update=()=>{192&e.$$.dirty&&(n(0,r=c.action?c.action.bind(l.tour):null),n(1,i=c.classes),n(2,o=!!c.disabled&&f(c.disabled)),n(3,a=c.label?f(c.label):null),n(4,s=c.secondary),n(5,u=c.text?f(c.text):null))},[r,i,o,a,s,u,c,l]}class xt extends bt{constructor(e){super(),yt(this,e,wt,Ot,Qe,{config:6,step:7})}}function kt(e,t,n){const r=e.slice();return r[2]=t[n],r}function St(e){let t,n,r=e[1],i=[];for(let t=0;tpt(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{r=null})),ft())},i(e){n||(ht(r),n=!0)},o(e){pt(r),n=!1},d(e){e&&De(t),r&&r.d()}}}function Et(e,t,n){let r,{step:i}=t;return e.$$set=e=>{"step"in e&&n(0,i=e.step)},e.$$.update=()=>{1&e.$$.dirty&&n(1,r=i.options.buttons)},[i,r]}class Tt extends bt{constructor(e){super(),yt(this,e,Et,Pt,Qe,{step:0})}}function jt(e){let t,n,r,i,o;return{c(){t=Ne("button"),n=Ne("span"),n.textContent="×",Ue(n,"aria-hidden","true"),Ue(t,"aria-label",r=e[0].label?e[0].label:"Close Tour"),Ue(t,"class","shepherd-cancel-icon"),Ue(t,"type","button")},m(r,a){Me(r,t,a),Ie(t,n),i||(o=ze(t,"click",e[1]),i=!0)},p(e,[n]){1&n&&r!==(r=e[0].label?e[0].label:"Close Tour")&&Ue(t,"aria-label",r)},i:Te,o:Te,d(e){e&&De(t),i=!1,o()}}}function Ct(e,t,n){let{cancelIcon:r,step:i}=t;return e.$$set=e=>{"cancelIcon"in e&&n(0,r=e.cancelIcon),"step"in e&&n(2,i=e.step)},[r,e=>{e.preventDefault(),i.cancel()},i]}class At extends bt{constructor(e){super(),yt(this,e,Ct,jt,Qe,{cancelIcon:0,step:2})}}function Rt(e){let t;return{c(){t=Ne("h3"),Ue(t,"id",e[1]),Ue(t,"class","shepherd-title")},m(n,r){Me(n,t,r),e[3](t)},p(e,[n]){2&n&&Ue(t,"id",e[1])},i:Te,o:Te,d(n){n&&De(t),e[3](null)}}}function $t(e,t,n){let{labelId:r,element:i,title:o}=t;return Ge((()=>{p(o)&&n(2,o=o()),n(0,i.innerHTML=o,i)})),e.$$set=e=>{"labelId"in e&&n(1,r=e.labelId),"element"in e&&n(0,i=e.element),"title"in e&&n(2,o=e.title)},[i,r,o,function(e){Ke[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class Qt extends bt{constructor(e){super(),yt(this,e,$t,Rt,Qe,{labelId:1,element:0,title:2})}}function It(e){let t,n;return t=new Qt({props:{labelId:e[0],title:e[2]}}),{c(){dt(t.$$.fragment)},m(e,r){mt(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.labelId=e[0]),4&n&&(r.title=e[2]),t.$set(r)},i(e){n||(ht(t.$$.fragment,e),n=!0)},o(e){pt(t.$$.fragment,e),n=!1},d(e){vt(t,e)}}}function Mt(e){let t,n;return t=new At({props:{cancelIcon:e[3],step:e[1]}}),{c(){dt(t.$$.fragment)},m(e,r){mt(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.cancelIcon=e[3]),2&n&&(r.step=e[1]),t.$set(r)},i(e){n||(ht(t.$$.fragment,e),n=!0)},o(e){pt(t.$$.fragment,e),n=!1},d(e){vt(t,e)}}}function Dt(e){let t,n,r,i=e[2]&&It(e),o=e[3]&&e[3].enabled&&Mt(e);return{c(){t=Ne("header"),i&&i.c(),n=qe(),o&&o.c(),Ue(t,"class","shepherd-header")},m(e,a){Me(e,t,a),i&&i.m(t,null),Ie(t,n),o&&o.m(t,null),r=!0},p(e,[r]){e[2]?i?(i.p(e,r),4&r&&ht(i,1)):(i=It(e),i.c(),ht(i,1),i.m(t,n)):i&&(lt(),pt(i,1,1,(()=>{i=null})),ft()),e[3]&&e[3].enabled?o?(o.p(e,r),8&r&&ht(o,1)):(o=Mt(e),o.c(),ht(o,1),o.m(t,null)):o&&(lt(),pt(o,1,1,(()=>{o=null})),ft())},i(e){r||(ht(i),ht(o),r=!0)},o(e){pt(i),pt(o),r=!1},d(e){e&&De(t),i&&i.d(),o&&o.d()}}}function Nt(e,t,n){let r,i,{labelId:o,step:a}=t;return e.$$set=e=>{"labelId"in e&&n(0,o=e.labelId),"step"in e&&n(1,a=e.step)},e.$$.update=()=>{2&e.$$.dirty&&(n(2,r=a.options.title),n(3,i=a.options.cancelIcon))},[o,a,r,i]}class Ft extends bt{constructor(e){super(),yt(this,e,Nt,Dt,Qe,{labelId:0,step:1})}}function Lt(e){let t;return{c(){t=Ne("div"),Ue(t,"class","shepherd-text"),Ue(t,"id",e[1])},m(n,r){Me(n,t,r),e[3](t)},p(e,[n]){2&n&&Ue(t,"id",e[1])},i:Te,o:Te,d(n){n&&De(t),e[3](null)}}}function qt(e,t,n){let{descriptionId:r,element:i,step:o}=t;return Ge((()=>{let{text:e}=o.options;p(e)&&(e=e.call(o)),h(e)?i.appendChild(e):n(0,i.innerHTML=e,i)})),e.$$set=e=>{"descriptionId"in e&&n(1,r=e.descriptionId),"element"in e&&n(0,i=e.element),"step"in e&&n(2,o=e.step)},[i,r,o,function(e){Ke[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class zt extends bt{constructor(e){super(),yt(this,e,qt,Lt,Qe,{descriptionId:1,element:0,step:2})}}function Ut(e){let t,n;return t=new Ft({props:{labelId:e[1],step:e[2]}}),{c(){dt(t.$$.fragment)},m(e,r){mt(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.labelId=e[1]),4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ht(t.$$.fragment,e),n=!0)},o(e){pt(t.$$.fragment,e),n=!1},d(e){vt(t,e)}}}function Bt(e){let t,n;return t=new zt({props:{descriptionId:e[0],step:e[2]}}),{c(){dt(t.$$.fragment)},m(e,r){mt(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.descriptionId=e[0]),4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ht(t.$$.fragment,e),n=!0)},o(e){pt(t.$$.fragment,e),n=!1},d(e){vt(t,e)}}}function Zt(e){let t,n;return t=new Tt({props:{step:e[2]}}),{c(){dt(t.$$.fragment)},m(e,r){mt(t,e,r),n=!0},p(e,n){const r={};4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ht(t.$$.fragment,e),n=!0)},o(e){pt(t.$$.fragment,e),n=!1},d(e){vt(t,e)}}}function Vt(e){let t,n,r,i,o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,a=!m(e[2].options.text),s=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,u=o&&Ut(e),c=a&&Bt(e),l=s&&Zt(e);return{c(){t=Ne("div"),u&&u.c(),n=qe(),c&&c.c(),r=qe(),l&&l.c(),Ue(t,"class","shepherd-content")},m(e,o){Me(e,t,o),u&&u.m(t,null),Ie(t,n),c&&c.m(t,null),Ie(t,r),l&&l.m(t,null),i=!0},p(e,[i]){4&i&&(o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled),o?u?(u.p(e,i),4&i&&ht(u,1)):(u=Ut(e),u.c(),ht(u,1),u.m(t,n)):u&&(lt(),pt(u,1,1,(()=>{u=null})),ft()),4&i&&(a=!m(e[2].options.text)),a?c?(c.p(e,i),4&i&&ht(c,1)):(c=Bt(e),c.c(),ht(c,1),c.m(t,r)):c&&(lt(),pt(c,1,1,(()=>{c=null})),ft()),4&i&&(s=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length),s?l?(l.p(e,i),4&i&&ht(l,1)):(l=Zt(e),l.c(),ht(l,1),l.m(t,null)):l&&(lt(),pt(l,1,1,(()=>{l=null})),ft())},i(e){i||(ht(u),ht(c),ht(l),i=!0)},o(e){pt(u),pt(c),pt(l),i=!1},d(e){e&&De(t),u&&u.d(),c&&c.d(),l&&l.d()}}}function Wt(e,t,n){let{descriptionId:r,labelId:i,step:o}=t;return e.$$set=e=>{"descriptionId"in e&&n(0,r=e.descriptionId),"labelId"in e&&n(1,i=e.labelId),"step"in e&&n(2,o=e.step)},[r,i,o]}class Xt extends bt{constructor(e){super(),yt(this,e,Wt,Vt,Qe,{descriptionId:0,labelId:1,step:2})}}function Yt(e){let t;return{c(){t=Ne("div"),Ue(t,"class","shepherd-arrow"),Ue(t,"data-popper-arrow","")},m(e,n){Me(e,t,n)},d(e){e&&De(t)}}}function Gt(e){let t,n,r,i,o,a,s,u,c=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&Yt();r=new Xt({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let l=[{"aria-describedby":i=m(e[4].options.text)?null:e[2]},{"aria-labelledby":o=e[4].options.title?e[3]:null},e[1],{role:"dialog"},{tabindex:"0"}],f={};for(let e=0;e!!e.length))}function Kt(e,t,n){let r,i,o,{classPrefix:a,element:s,descriptionId:u,firstFocusableElement:c,focusableElements:l,labelId:f,lastFocusableElement:h,step:p,dataStepId:m}=t;var v;v=()=>{n(1,m={[`data-${a}shepherd-step-id`]:p.id}),n(9,l=s.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=l[0]),n(10,h=l[l.length-1])},Ye().$$.on_mount.push(v),Ge((()=>{o!==p.options.classes&&(function(e){if(d(e)){const t=Ht(e);t.length&&s.classList.remove(...t)}}(o),o=p.options.classes,function(e){if(d(e)){const t=Ht(e);t.length&&s.classList.add(...t)}}(o))}));return e.$$set=e=>{"classPrefix"in e&&n(11,a=e.classPrefix),"element"in e&&n(0,s=e.element),"descriptionId"in e&&n(2,u=e.descriptionId),"firstFocusableElement"in e&&n(8,c=e.firstFocusableElement),"focusableElements"in e&&n(9,l=e.focusableElements),"labelId"in e&&n(3,f=e.labelId),"lastFocusableElement"in e&&n(10,h=e.lastFocusableElement),"step"in e&&n(4,p=e.step),"dataStepId"in e&&n(1,m=e.dataStepId)},e.$$.update=()=>{16&e.$$.dirty&&(n(5,r=p.options&&p.options.cancelIcon&&p.options.cancelIcon.enabled),n(6,i=p.options&&p.options.title))},[s,m,u,f,p,r,i,e=>{const{tour:t}=p;switch(e.keyCode){case 9:if(0===l.length){e.preventDefault();break}e.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(e.preventDefault(),h.focus()):document.activeElement===h&&(e.preventDefault(),c.focus());break;case 27:t.options.exitOnEsc&&(e.stopPropagation(),p.cancel());break;case 37:t.options.keyboardNavigation&&(e.stopPropagation(),t.back());break;case 39:t.options.keyboardNavigation&&(e.stopPropagation(),t.next())}},c,l,h,a,()=>s,function(e){Ke[e?"unshift":"push"]((()=>{s=e,n(0,s)}))}]}class Jt extends bt{constructor(e){super(),yt(this,e,Kt,Gt,Qe,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}class en extends v{constructor(e,t={}){return super(e,t),this.tour=e,this.classPrefix=this.tour.options?b(this.tour.options.classPrefix):"",this.styles=e.styles,this._resolvedAttachTo=null,g(this),this._setOptions(t),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){var e;(e=this).cleanup&&e.cleanup(),e.cleanup=null,h(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(e){const t=e.options.attachTo||{},n=Object.assign({},t);if(p(n.element)&&(n.element=n.element.call(e)),d(n.element)){try{n.element=document.querySelector(n.element)}catch(e){}n.element||console.error(`The element for this Shepherd step was not found ${t.element}`)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){return p(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then((()=>this._show())):Promise.resolve(this._show())}updateStepOptions(e){Object.assign(this.options,e),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const e=`${this.id}-description`,t=`${this.id}-label`;return this.shepherdElementComponent=new Jt({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:e,labelId:t,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(e){const{element:t}=this._getResolvedAttachToOptions();p(this.options.scrollToHandler)?this.options.scrollToHandler(t):t instanceof Element&&"function"==typeof t.scrollIntoView&&t.scrollIntoView(e)}_getClassOptions(e){const t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=e.classes?e.classes:"",r=t&&t.classes?t.classes:"",i=[...n.split(" "),...r.split(" ")],o=new Set(i);return Array.from(o).join(" ").trim()}_setOptions(e={}){let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=f({},t||{}),this.options=Object.assign({arrow:!0},t,e,function(e,t){return{floatingUIOptions:f(e.floatingUIOptions||{},t.floatingUIOptions||{})}}(t,e));const{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||`step-${w()}`,n&&Object.keys(n).forEach((e=>{this.on(e,n[e],this)}))}_setupElements(){m(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&y(this),Ee(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout((()=>{this._scrollTo(this.options.scrollTo)})),this.el.hidden=!1;const e=this.shepherdElementComponent.getElement(),t=this.target||document.body;t.classList.add(`${this.classPrefix}shepherd-enabled`),t.classList.add(`${this.classPrefix}shepherd-target`),e.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(e){const t=e.target;t&&(e.options.highlightClass&&t.classList.add(e.options.highlightClass),t.classList.remove("shepherd-target-click-disabled"),!1===e.options.canClickTarget&&t.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const e=this.target||document.body;this.options.highlightClass&&e.classList.remove(this.options.highlightClass),e.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}}function tn(e){let t,n,r,i,o;return{c(){t=Fe("svg"),n=Fe("path"),Ue(n,"d",e[2]),Ue(t,"class",r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,a){Me(r,t,a),Ie(t,n),e[11](t),i||(o=ze(t,"touchmove",e[3]),i=!0)},p(e,[i]){4&i&&Ue(n,"d",e[2]),2&i&&r!==(r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&Ue(t,"class",r)},i:Te,o:Te,d(n){n&&De(t),e[11](null),i=!1,o()}}}function nn(e){if(!e)return null;const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==t&&"visible"!==t&&e.scrollHeight>=e.clientHeight?e:nn(e.parentElement)}function rn(e,t,n){let{element:r,openingProperties:i}=t;w();let o,a,s=!1;u();function u(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,s=!1),p()}function l(e=0,t=0,r,o){if(o){const{y:a,height:s}=function(e,t){const n=e.getBoundingClientRect();let r=n.y||n.top,i=n.bottom||r+n.height;if(t){const e=t.getBoundingClientRect(),n=e.y||e.top,o=e.bottom||n+e.height;r=Math.max(r,n),i=Math.min(i,o)}return{y:r,height:Math.max(i-r,0)}}(o,r),{x:u,width:c,left:l}=o.getBoundingClientRect();n(4,i={width:c+2*e,height:s+2*e,x:(u||l)-e,y:a-e,r:t})}else u()}function f(){n(1,s=!0)}const h=e=>{e.preventDefault()};function p(){o&&(cancelAnimationFrame(o),o=void 0),window.removeEventListener("touchmove",h,{passive:!1})}return e.$$set=e=>{"element"in e&&n(0,r=e.element),"openingProperties"in e&&n(4,i=e.openingProperties)},e.$$.update=()=>{16&e.$$.dirty&&n(2,a=function({width:e,height:t,x:n=0,y:r=0,r:i=0}){const{innerWidth:o,innerHeight:a}=window,{topLeft:s=0,topRight:u=0,bottomRight:c=0,bottomLeft:l=0}="number"==typeof i?{topLeft:i,topRight:i,bottomRight:i,bottomLeft:i}:i;return`M${o},${a}H0V0H${o}V${a}ZM${n+s},${r}a${s},${s},0,0,0-${s},${s}V${t+r-l}a${l},${l},0,0,0,${l},${l}H${e+n-c}a${c},${c},0,0,0,${c}-${c}V${r+u}a${u},${u},0,0,0-${u}-${u}Z`}(i))},[r,s,a,e=>{e.stopPropagation()},i,()=>r,u,c,l,function(e){p(),e.tour.options.useModalOverlay?(!function(e){const{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n}=e.options,r=nn(e.target),i=()=>{o=void 0,l(t,n,r,e.target),o=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",h,{passive:!1})}(e),f()):c()},f,function(e){Ke[e?"unshift":"push"]((()=>{r=e,n(0,r)}))}]}class on extends bt{constructor(e){super(),yt(this,e,rn,tn,Qe,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const an=new v;class sn extends v{constructor(e={}){super(e),g(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=b(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map((e=>{(e=>{this.on(e,(t=>{(t=t||{}).tour=this,an.trigger(e,t)}))})(e)})),this._setTourID(),this}addStep(e,t){let n=e;return n instanceof en?n.tour=this:n=new en(this,n),m(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach((e=>{this.addStep(e)})),this}back(){const e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}async cancel(){if(this.options.confirmCancel){const e="function"==typeof this.options.confirmCancel,t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";(e?await this.options.confirmCancel():window.confirm(t))&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find((t=>t.id===e))}getCurrentStep(){return this.currentStep}hide(){const e=this.getCurrentStep();if(e)return e.hide()}isActive(){return an.activeTour===this}next(){const e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){const t=this.getCurrentStep();this.steps.some(((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0})),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e=0,t=!0){const n=d(e)?this.getById(e):this.steps[e];if(n){this._updateStateBeforeShow();p(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(e){const t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach((e=>e.destroy())),function(e){if(e){const{steps:t}=e;t.forEach((e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&e.target instanceof HTMLElement&&e.target.classList.remove("shepherd-target-click-disabled")}))}}(this),this.trigger(e,{index:t}),an.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){const e=document.querySelector(".shepherd-modal-overlay-container");e&&e.remove()}h(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),an.activeTour=this}_setupModal(){this.modal=new on({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(e,t){const n=this.steps.indexOf(e);if(n===this.steps.length-1)this.complete();else{const e=t?n+1:n-1;this.show(e,t)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const e=this.options.tourName||"tour";this.id=`${e}--${w()}`}}const un="undefined"==typeof window;class cn{constructor(){}}un?Object.assign(an,{Tour:cn,Step:cn}):Object.assign(an,{Tour:sn,Step:en})},914:function(e,t,n){"use strict";function r(){}n.d(t,"a",(function(){return i}));class i{constructor(e=1/0,t=r){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}},915:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(10),i=n(18),o=n(54),a=n(842),s=function(e){var t=e.client,n=e.children,s=Object(a.a)(),u=o.useContext(s),c=o.useMemo((function(){return Object(r.__assign)(Object(r.__assign)({},u),{client:t||u.client})}),[u,t]);return Object(i.c)(c.client,47),o.createElement(s.Provider,{value:c},n)}},917:function(e,t,n){"use strict";n.d(t,"a",(function(){return Wt}));var r=n(65),i=n(92),o=n(242),a=n(50),s=n(493),u=n(155),c=n(77);const l=[];function f(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach((e=>{e.isDefaultInstance=!0})),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?Object(i.c)(n(t)):t;const o=function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.keys(t).map((e=>t[e]))}(r),a=function(e,t){for(let n=0;n"Debug"===e.name));if(-1!==a){const[e]=o.splice(a,1);o.push(e)}return o}function h(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function p(e,t,n){if(n[t.name])a.a&&r.c.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===l.indexOf(t.name)&&(t.setupOnce(s.a,c.a),l.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}a.a&&r.c.log(`Integration installed: ${t.name}`)}}function d(e,t){return Object.assign((function(...e){return t(...e)}),{id:e})}const m=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],v=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],g="InboundFilters",y=(e={})=>({name:g,setupOnce(){},processEvent(t,n,s){const u=s.getOptions(),c=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:m],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:v],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,u);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return a.a&&r.c.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Object(i.e)(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return function(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch(e){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));a.a&&0===t.length&&r.c.error(`Could not extract message for event ${Object(i.e)(e)}`);return t}(e).some((e=>Object(o.c)(e,t)))}(e,t.ignoreErrors))return a.a&&r.c.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Object(i.e)(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&Object(o.c)(n,t)}(e,t.ignoreTransactions))return a.a&&r.c.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Object(i.e)(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=b(e);return!!n&&Object(o.c)(n,t)}(e,t.denyUrls))return a.a&&r.c.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Object(i.e)(e)}.\nUrl: ${b(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=b(e);return!n||Object(o.c)(n,t)}(e,t.allowUrls))return a.a&&r.c.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Object(i.e)(e)}.\nUrl: ${b(e)}`),!0;return!1}(t,c)?null:t}});d(g,y);function b(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return a.a&&r.c.error(`Cannot extract url for event ${Object(i.e)(e)}`),null}}var O=n(69);let w;const x="FunctionToString",k=new WeakMap,S=()=>({name:x,setupOnce(){w=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Object(O.f)(this),n=k.has(Object(u.e)())&&void 0!==t?t:this;return w.apply(n,e)}}catch(e){}},setup(e){k.set(e,!0)}});d(x,S);function _(e,t){!0===t.debug&&(a.a?r.c.enable():Object(r.b)((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));Object(u.f)().update(t.initialScope);const n=new e(t);!function(e){const t=Object(c.a)().getStackTop();t.client=e,t.scope.setClient(e)}(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)}var P=n(213);const E=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function T(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:a,protocol:s,publicKey:u}=e;return`${s}://${u}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${a}`}function j(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function C(e){const t="string"==typeof e?function(e){const t=E.exec(e);if(!t)return void Object(r.b)((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,i,o="",a,s="",u]=t.slice(1);let c="",l=u;const f=l.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),l=f.pop()),l){const e=l.match(/^\d+/);e&&(l=e[0])}return j({host:a,pass:o,path:c,projectId:l,port:s,protocol:n,publicKey:i})}(e):j(e);if(t&&function(e){if(!P.a)return!0;const{port:t,projectId:n,protocol:i}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(r.c.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(i)?t&&isNaN(parseInt(t,10))&&(r.c.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(r.c.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),1):(r.c.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}function A(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function R(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${A(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return Object(O.h)({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}(e,r)}`}var $=n(813),Q=n(37);const I=Object(Q.b)();function M(){if(!("fetch"in I))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function D(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const N=Object(Q.b)();const F={},L={};function q(e,t){F[e]=F[e]||[],F[e].push(t)}function z(e,t){L[e]||(t(),L[e]=!0)}function U(e,t){const n=e&&F[e];if(n)for(const i of n)try{i(t)}catch(t){P.a&&r.c.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Object($.b)(i)}\nError:`,t)}}const B=Q.a;let Z;function V(e){const t="history";q(t,e),z(t,W)}function W(){if(!function(){const e=N.chrome,t=e&&e.app&&e.app.runtime,n="history"in N&&!!N.history.pushState&&!!N.history.replaceState;return!t&&n}())return;const e=B.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=Z,t=String(n);Z=t;U("history",{from:e,to:t})}return e.apply(this,t)}}B.onpopstate=function(...t){const n=B.location.href,r=Z;Z=n;if(U("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},Object(O.e)(B.history,"pushState",t),Object(O.e)(B.history,"replaceState",t)}var X=n(57),Y=n(782),G=n(497);function H(e,t=[]){return[e,t]}function K(e,t){const[n,r]=e;return[n,[...r,t]]}function J(e,t){const n=e[1];for(const e of n){if(t(e,e[0].type))return!0}return!1}function ee(e,t){return(t||new TextEncoder).encode(e)}function te(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[ee(i,t),e]:i.push("string"==typeof e?ee(e,t):e)}for(const e of r){const[t,n]=e;if(o(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)o(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify(Object(G.a)(n))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(i)}function ne(e,t){const n="string"==typeof e.data?ee(e.data,t):e.data;return[Object(O.c)({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const re={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",statsd:"unknown"};function ie(e){return re[e]}function oe(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}class ae extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function se(e,t,n,r){const i=oe(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:T(r)},...i&&{trace:Object(O.c)({...i})}}}(e,i,r,t);delete e.sdkProcessingMetadata;return H(a,[[{type:o},e]])}function ue(e,t,n,r){const i={sent_at:(new Date).toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(i.dsn=T(t));const o=function(e){const t=function(e){let t="";for(const n of e){const e=Object.entries(n.tags),r=e.length>0?`|#${e.map((([e,t])=>`${e}:${t}`)).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return H(i,[o])}var ce=n(219),le=n(800),fe=n(801);const he="Not capturing exception because it's already been captured.";class pe{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=C(e.dsn):a.a&&r.c.warn("No DSN provided, client will not send events."),this._dsn){const t=R(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(Object(i.d)(e))return void(a.a&&r.c.log(he));let o=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{o=e}))),o}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=Object(X.i)(e)?e:String(e),a=Object(X.k)(e)?this.eventFromMessage(o,t,n):this.eventFromException(e,n);return this._process(a.then((e=>this._captureEvent(e,n,r))).then((e=>{i=e}))),i}captureEvent(e,t,n){if(t&&t.originalException&&Object(i.d)(t.originalException))return void(a.a&&r.c.log(he));let o=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{o=e}))),o}captureSession(e){"string"!=typeof e.release?a.a&&r.c.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Object(ce.c)(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):Object(Y.c)(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return a.a&&r.c.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];p(this,e,this._integrations),t||h(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=se(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=K(n,ne(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}sendSession(e){const t=function(e,t,n,r){const i=oe(n);return H({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:T(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;a.a&&r.c.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){a.a&&r.c.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=ue(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach((t=>{t&&p(e,t,n)})),n}(this,e),h(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(Object(ce.c)(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Y.a((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r=Object(c.b)()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),Object(fe.b)(i,e,t,n,this,r).then((e=>{if(null===e)return e;const t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(e.contexts&&e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:a}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const s=a||Object(le.a)(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if(a.a){const t=e;"log"===t.logLevel?r.c.log(t.message):r.c.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,o=me(e),a=de(e),s=e.type||"error",u=`before send for type \`${s}\``;if(a&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),Object(Y.b)(new ae(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const c="replay_event"===s?"replay":s;return this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",c,e),new ae("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;if(de(t)&&r)return r(t,n);if(me(t)&&i)return i(t,n);return t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Object(X.o)(e))return e.then((e=>{if(!Object(X.j)(e)&&null!==e)throw new ae(n);return e}),(e=>{throw new ae(`${t} rejected with ${e}`)}));if(!Object(X.j)(e)&&null!==e)throw new ae(n);return e}(i,u)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new ae(`${u} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);const a=r.transaction_info;if(o&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof ae)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new ae(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,(e=>{a.a&&r.c.error("Error while sending event:",e)}));a.a&&r.c.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function de(e){return void 0===e.type}function me(e){return"transaction"===e.type}var ve=n(774);var ge=n(487);const ye="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function be(e,t){const n=we(e,t),r={type:t&&t.name,value:ke(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Oe(e,t){return{exception:{values:[be(e,t)]}}}function we(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(xe.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}const xe=/Minified React error #\d+;/i;function ke(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Se(e,t,n,r,o){let a;if(Object(X.e)(t)&&t.error){return Oe(e,t.error)}if(Object(X.a)(t)||Object(X.b)(t)){const o=t;if("stack"in t)a=Oe(e,t);else{const t=o.name||(Object(X.a)(o)?"DOMError":"DOMException"),s=o.message?`${t}: ${o.message}`:t;a=_e(e,s,n,r),Object(i.b)(a,s)}return"code"in o&&(a.tags={...a.tags,"DOMException.code":`${o.code}`}),a}if(Object(X.d)(t))return Oe(e,t);if(Object(X.j)(t)||Object(X.f)(t)){return a=function(e,t,n,r){const i=Object(u.e)(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:Object(X.f)(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Pe(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Object(G.b)(t,o)}};if(n){const t=we(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,o),Object(i.a)(a,{synthetic:!0}),a}return a=_e(e,t,n,r),Object(i.b)(a,`${t}`,void 0),Object(i.a)(a,{synthetic:!0}),a}function _e(e,t,n,r){const i={};if(r&&n){const r=we(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if(Object(X.i)(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Pe(e,{isUnhandledRejection:t}){const n=Object(O.d)(e),r=t?"promise rejection":"exception";if(Object(X.e)(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if(Object(X.f)(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}const Ee=Q.a;let Te=0;function je(){return Te>0}function Ce(){Te++,setTimeout((()=>{Te--}))}function Ae(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(Object(O.f)(e))return e}catch(t){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map((e=>Ae(e,t)));return e.apply(this,i)}catch(e){throw Ce(),Object(u.j)((n=>{n.addEventProcessor((e=>(t.mechanism&&(Object(i.b)(e,void 0,void 0),Object(i.a)(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),Object(u.c)(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}Object(O.g)(r,e),Object(O.a)(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}class Re extends pe{constructor(e){!function(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${r}:@sentry/${e}`,version:ve.a}))),version:ve.a}),e._metadata=i}(e,"browser",["browser"],Ee.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Ee.document&&Ee.document.addEventListener("visibilitychange",(()=>{"hidden"===Ee.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const o=Se(e,t,n&&n.syntheticException||void 0,r);return Object(i.a)(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),Object(Y.c)(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=_e(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Object(Y.c)(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(ye&&r.c.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:T(r)}},o=function(e){return[{type:"user_report"},e]}(e);return H(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(ye&&r.c.log("No outcomes to send"));if(!this._dsn)return void(ye&&r.c.log("No dsn provided, will not send outcomes"));ye&&r.c.log("Sending outcomes:",e);const t=(n=e,H((i=this._options.tunnel&&T(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:o||Object(ge.a)(),discarded_events:n}]]));var n,i,o;this._sendEnvelope(t)}}function $e(){"console"in Q.a&&r.a.forEach((function(e){e in Q.a.console&&Object(O.e)(Q.a.console,e,(function(t){return r.d[e]=t,function(...t){U("console",{args:t,level:e});const n=r.d[e];n&&n.apply(Q.a.console,t)}}))}))}const Qe=Q.a;let Ie,Me,De;function Ne(){if(!Qe.document)return;const e=U.bind(null,"dom"),t=Fe(e,!0);Qe.document.addEventListener("click",t,!1),Qe.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=Qe[t]&&Qe[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Object(O.e)(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){const r=Fe(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch(e){}return t.call(this,n,r,i)}})),Object(O.e)(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}function Fe(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(e){return null}}(n);if(function(e,t){return"keypress"===e&&(!t||!t.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Object(O.a)(n,"_sentryCaptured",!0),r&&!r._sentryId&&Object(O.a)(r,"_sentryId",Object(i.f)());const o="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==Me)return!1;try{if(!e.target||e.target._sentryId!==De)return!1}catch(e){}return!0}(n)){e({event:n,name:o,global:t}),Me=n.type,De=r?r._sentryId:void 0}clearTimeout(Ie),Ie=Qe.setTimeout((()=>{De=void 0,Me=void 0}),1e3)}}const Le=Q.a,qe="__sentry_xhr_v3__";function ze(){if(!Le.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Object(O.e)(e,"open",(function(e){return function(...t){const n=Date.now(),r=Object(X.m)(t[0])?t[0].toUpperCase():void 0,i=function(e){if(Object(X.m)(e))return e;try{return e.toString()}catch(e){}return}(t[1]);if(!r||!i)return e.apply(this,t);this[qe]={method:r,url:i,request_headers:{}},"POST"===r&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[qe];if(e&&4===this.readyState){try{e.status_code=this.status}catch(e){}U("xhr",{args:[r,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?Object(O.e)(this,"onreadystatechange",(function(e){return function(...t){return o(),e.apply(this,t)}})):this.addEventListener("readystatechange",o),Object(O.e)(this,"setRequestHeader",(function(e){return function(...t){const[n,r]=t,i=this[qe];return i&&Object(X.m)(n)&&Object(X.m)(r)&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}})),e.apply(this,t)}})),Object(O.e)(e,"send",(function(e){return function(...t){const n=this[qe];if(!n)return e.apply(this,t);void 0!==t[0]&&(n.body=t[0]);return U("xhr",{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}function Ue(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!M())return!1;if(D(I.fetch))return!0;let e=!1;const t=I.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=D(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){P.a&&r.c.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&Object(O.e)(Q.a,"fetch",(function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Ze(t),method:Be(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Ze(t),method:Be(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return U("fetch",{...i}),e.apply(Q.a,t).then((e=>(U("fetch",{...i,endTimestamp:Date.now(),response:e}),e)),(e=>{throw U("fetch",{...i,endTimestamp:Date.now(),error:e}),e}))}}))}function Be(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Ze(e){return"string"==typeof e?e:e?Be(e,"url")?e.url:e.toString?e.toString():"":""}var Ve=n(902);const We=["fatal","error","warning","log","info","debug"];function Xe(e){return"warn"===e?"warning":We.includes(e)?e:"log"}function Ye(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const Ge=1024,He="Breadcrumbs",Ke=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:He,setupOnce(){},setup(e){var n;t.console&&function(e){const t="console";q(t,e),z(t,$e)}(function(e){return function(t){if(Object(u.e)()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:Xe(t.level),message:Object(o.a)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${Object(o.a)(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}Object(u.a)(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(Object(u.e)()!==e)return;let i,o,a="object"==typeof t?t.serializeAttribute:void 0,s="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;s&&s>Ge&&(ye&&r.c.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${s} was configured. Sentry will use 1024 instead.`),s=Ge),"string"==typeof a&&(a=[a]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;i=Object(Ve.c)(t,{keyAttrs:a,maxStringLength:s}),o=Object(Ve.a)(t)}catch(e){i=""}if(0===i.length)return;const c={category:`ui.${n.name}`,message:i};o&&(c.data={"ui.component_name":o}),Object(u.a)(c,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),q("dom",n),z("dom",Ne)),t.xhr&&function(e){q("xhr",e),z("xhr",ze)}(function(e){return function(t){if(Object(u.e)()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[qe];if(!n||!r||!i)return;const{method:o,url:a,status_code:s,body:c}=i,l={method:o,url:a,status_code:s},f={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r};Object(u.a)({category:"xhr",data:l,type:"http"},f)}}(e)),t.fetch&&function(e){const t="fetch";q(t,e),z(t,Ue)}(function(e){return function(t){if(Object(u.e)()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const e=t.fetchData,i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r};Object(u.a)({category:"fetch",data:e,level:"error",type:"http"},i)}else{const e=t.response,i={...t.fetchData,status_code:e&&e.status},o={input:t.args,response:e,startTimestamp:n,endTimestamp:r};Object(u.a)({category:"fetch",data:i,type:"http"},o)}}}(e)),t.history&&V(function(e){return function(t){if(Object(u.e)()!==e)return;let n=t.from,r=t.to;const i=Ye(Ee.location.href);let o=n?Ye(n):void 0;const a=Ye(r);o&&o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),Object(u.a)({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){Object(u.e)()===e&&Object(u.a)({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Object(i.e)(t)},{event:t})}}(e))}}};d(He,Ke);const Je="Dedupe",et=()=>{let e;return{name:Je,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!nt(e,t))return!1;if(!tt(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=rt(t),r=rt(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!nt(e,t))return!1;if(!tt(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return ye&&r.c.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};d(Je,et);function tt(e,t){let n=it(e),r=it(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:ct,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";q(t,e),z(t,at)}((t=>{const{stackParser:n,attachStacktrace:r}=pt();if(Object(u.e)()!==e||je())return;const{msg:i,url:o,line:a,column:s,error:c}=t,l=void 0===c&&Object(X.m)(i)?function(e,t,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Object(X.e)(e)?e.message:e,a="Error";const s=o.match(i);s&&(a=s[1],o=s[2]);const u={exception:{values:[{type:a,value:o}]}};return ft(u,t,n,r)}(i,o,a,s):ft(Se(n,c||i,void 0,r,!1),o,a,s);l.level="error",Object(u.b)(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})}))}(e),ht("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";q(t,e),z(t,ut)}((t=>{const{stackParser:n,attachStacktrace:r}=pt();if(Object(u.e)()!==e||je())return;const i=function(e){if(Object(X.k)(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(e){}return e}(t),o=Object(X.k)(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Se(n,i,void 0,r,!0);o.level="error",Object(u.b)(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(e),ht("onunhandledrejection"))}}};d(ct,lt);function ft(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},u=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,f=Object(X.m)(t)&&t.length>0?t:Object(Ve.b)();return 0===u.length&&u.push({colno:c,filename:f,function:"?",in_app:!0,lineno:l}),e}function ht(e){ye&&r.c.log(`Global Handler attached: ${e}`)}function pt(){const e=Object(u.e)();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const dt="HttpContext",mt=()=>({name:dt,setupOnce(){},preprocessEvent(e){if(!Ee.navigator&&!Ee.location&&!Ee.document)return;const t=e.request&&e.request.url||Ee.location&&Ee.location.href,{referrer:n}=Ee.document||{},{userAgent:r}=Ee.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};e.request=o}});d(dt,mt);function vt(e,t,n=250,r,i,a,s){if(!(a.exception&&a.exception.values&&s&&Object(X.g)(s.originalException,Error)))return;const u=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;var c,l;u&&(a.exception.values=(c=gt(e,t,i,s.originalException,r,a.exception.values,u,0),l=n,c.map((e=>(e.value&&(e.value=Object(o.d)(e.value,l)),e)))))}function gt(e,t,n,r,i,o,a,s){if(o.length>=n+1)return o;let u=[...o];if(Object(X.g)(r[i],Error)){yt(a,s);const o=e(t,r[i]),c=u.length;bt(o,i,c,s),u=gt(e,t,n,r[i],i,[o,...u],o,c)}return Array.isArray(r.errors)&&r.errors.forEach(((r,o)=>{if(Object(X.g)(r,Error)){yt(a,s);const c=e(t,r),l=u.length;bt(c,`errors[${o}]`,l,s),u=gt(e,t,n,r,i,[c,...u],c,l)}})),u}function yt(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function bt(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const Ot="LinkedErrors",wt=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:Ot,setupOnce(){},preprocessEvent(e,r,i){const o=i.getOptions();vt(be,o.stackParser,o.maxValueLength,n,t,e,r)}}},xt=(d(Ot,wt),["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"]),kt="TryCatch",St=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:kt,setupOnce(){t.setTimeout&&Object(O.e)(Ee,"setTimeout",_t),t.setInterval&&Object(O.e)(Ee,"setInterval",_t),t.requestAnimationFrame&&Object(O.e)(Ee,"requestAnimationFrame",Pt),t.XMLHttpRequest&&"XMLHttpRequest"in Ee&&Object(O.e)(XMLHttpRequest.prototype,"send",Et);const e=t.eventTarget;if(e){(Array.isArray(e)?e:xt).forEach(Tt)}}}};d(kt,St);function _t(e){return function(...t){const n=t[0];return t[0]=Ae(n,{mechanism:{data:{function:Object($.b)(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Pt(e){return function(t){return e.apply(this,[Ae(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Object($.b)(e)},handled:!1,type:"instrument"}})])}}function Et(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&Object(O.e)(n,e,(function(t){const n={mechanism:{data:{function:e,handler:Object($.b)(t)},handled:!1,type:"instrument"}},r=Object(O.f)(t);return r&&(n.mechanism.data.handler=Object($.b)(r)),Ae(t,n)}))})),e.apply(this,t)}}function Tt(e){const t=Ee,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Object(O.e)(n,"addEventListener",(function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Ae(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Object($.b)(r),target:e},handled:!1,type:"instrument"}}))}catch(e){}return t.apply(this,[n,Ae(r,{mechanism:{data:{function:"addEventListener",handler:Object($.b)(r),target:e},handled:!1,type:"instrument"}}),i])}})),Object(O.e)(n,"removeEventListener",(function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(e){}return e.call(this,t,i,r)}})))}const jt="?";function Ct(e,t,n,r){const i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const At=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Rt=/\((\S*)(?::(\d+))(?::(\d+))\)/,$t=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Qt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,It=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Mt=[[30,e=>{const t=At.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Rt.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Nt(t[1]||jt,t[2]);return Ct(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,e=>{const t=$t.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Qt.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||jt;return[n,e]=Nt(n,e),Ct(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,e=>{const t=It.exec(e);return t?Ct(t[2],t[1]||jt,+t[3],t[4]?+t[4]:void 0):void 0}]],Dt=Object($.a)(...Mt),Nt=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:jt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function Ft(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.lengthn(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(e){return new Y.a(((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{Object(Y.c)(e).then((()=>{--i||(clearTimeout(o),n(!0))}),r)}))}))}}}function Lt(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(const e of o.trim().split(",")){const[t,n]=e.split(":",2),o=parseInt(t,10),a=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))i[e]=r+a;else i.all=r+a}else a?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}function qt(e,t,n=Ft(e.bufferSize||30)){let i={};function o(o){const s=[];if(J(o,((t,n)=>{const r=ie(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(i,r)){const i=zt(t,n);e.recordDroppedEvent("ratelimit_backoff",r,i)}else s.push(t)})),0===s.length)return Object(Y.c)();const u=H(o[0],s),c=t=>{J(u,((n,r)=>{const i=zt(n,r);e.recordDroppedEvent(t,ie(r),i)}))};return n.add((()=>t({body:te(u,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&a.a&&r.c.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),i=Lt(i,e),e)),(e=>{throw c("network_error"),e})))).then((e=>e),(e=>{if(e instanceof ae)return a.a&&r.c.error("Skipped sending event because buffer is full."),c("queue_overflow"),Object(Y.c)();throw e}))}return o.__sentry__baseTransport__=!0,{send:o,flush:e=>n.drain(e)}}function zt(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let Ut;function Bt(e,t=function(){if(Ut)return Ut;if(D(Ee.fetch))return Ut=Ee.fetch.bind(Ee);const e=Ee.document;let t=Ee.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){ye&&r.c.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Ut=t.bind(Ee)}()){let n=0,i=0;return qt(e,(function(r){const o=r.body.length;n+=o,i++;const a={body:r.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&i<15,...e.fetchOptions};try{return t(e.url,a).then((e=>(n-=o,i--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return Ut=void 0,n-=o,i--,Object(Y.b)(e)}}))}function Zt(e){return qt(e,(function(t){return new Y.a(((n,r)=>{const i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)}))}))}const Vt=[y(),S(),St(),Ke(),lt(),wt(),et(),mt()];function Wt(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Vt]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Ee.SENTRY_RELEASE&&Ee.SENTRY_RELEASE.id&&(e.release=Ee.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Object($.c)(e.stackParser||Dt),integrations:f(e),transport:e.transport||(M()?Bt:Zt)};_(Re,t),e.autoSessionTracking&&function(){if(void 0===Ee.document)return void(ye&&r.c.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));Object(u.i)({ignoreDuration:!0}),Object(u.d)(),V((({from:e,to:t})=>{void 0!==e&&e!==t&&(Object(u.i)({ignoreDuration:!0}),Object(u.d)())}))}()}},918:function(e,t,n){"use strict";var r=60103,i=60106,o=60107,a=60108,s=60114,u=60109,c=60110,l=60112,f=60113,h=60120,p=60115,d=60116,m=60121,v=60122,g=60117,y=60129,b=60131;if("function"==typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),i=O("react.portal"),o=O("react.fragment"),a=O("react.strict_mode"),s=O("react.profiler"),u=O("react.provider"),c=O("react.context"),l=O("react.forward_ref"),f=O("react.suspense"),h=O("react.suspense_list"),p=O("react.memo"),d=O("react.lazy"),m=O("react.block"),v=O("react.server.block"),g=O("react.fundamental"),y=O("react.debug_trace_mode"),b=O("react.legacy_hidden")}function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case o:case s:case a:case f:case h:return e;default:switch(e=e&&e.$$typeof){case c:case l:case d:case p:case u:return e;default:return t}}case i:return t}}}var x=u,k=r,S=l,_=o,P=d,E=p,T=i,j=s,C=a,A=f;t.ContextConsumer=c,t.ContextProvider=x,t.Element=k,t.ForwardRef=S,t.Fragment=_,t.Lazy=P,t.Memo=E,t.Portal=T,t.Profiler=j,t.StrictMode=C,t.Suspense=A,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===l},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===d},t.isMemo=function(e){return w(e)===p},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===y||e===a||e===f||e===h||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===u||e.$$typeof===c||e.$$typeof===l||e.$$typeof===g||e.$$typeof===m||e[0]===v)},t.typeOf=w},92:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return o}));var r=n(69),i=(n(242),n(37));function o(){const e=i.a,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(e){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function a(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function s(e){const{message:t,event_id:n}=e;if(t)return t;const r=a(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function u(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function c(e,t){const n=a(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function l(e){if(e&&e.__sentry_captured__)return!0;try{Object(r.a)(e,"__sentry_captured__",!0)}catch(e){}return!1}function f(e){return Array.isArray(e)?e:[e]}},936:function(e,t,n){"use strict";var r=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,g={};function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}function b(){}function O(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=y.prototype;var w=O.prototype=new b;w.constructor=O,v(w,y.prototype),w.isPureReactComponent=!0;var x=Array.isArray,k=Object.prototype.hasOwnProperty,S={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var i,o={},a=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)k.call(t,i)&&!_.hasOwnProperty(i)&&(o[i]=t[i]);var u=arguments.length-2;if(1===u)o.children=n;else if(1=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function P(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return O(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function $(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Q(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function I(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,o){return o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||$(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Q(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Q(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);$(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);$(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Q(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Q(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(239))},940:function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;su?u:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},941:function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,c-=8);e[n+p-d]|=128*m}},942:function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},945:function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},946:function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case h:case a:case u:case s:case d:return e;default:switch(e=e&&e.$$typeof){case l:case p:case g:case v:case c:return e;default:return t}}case o:return t}}}function k(e){return x(e)===h}t.AsyncMode=f,t.ConcurrentMode=h,t.ContextConsumer=l,t.ContextProvider=c,t.Element=i,t.ForwardRef=p,t.Fragment=a,t.Lazy=g,t.Memo=v,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=d,t.isAsyncMode=function(e){return k(e)||x(e)===f},t.isConcurrentMode=k,t.isContextConsumer=function(e){return x(e)===l},t.isContextProvider=function(e){return x(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return x(e)===p},t.isFragment=function(e){return x(e)===a},t.isLazy=function(e){return x(e)===g},t.isMemo=function(e){return x(e)===v},t.isPortal=function(e){return x(e)===o},t.isProfiler=function(e){return x(e)===u},t.isStrictMode=function(e){return x(e)===s},t.isSuspense=function(e){return x(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===h||e===u||e===s||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===c||e.$$typeof===l||e.$$typeof===p||e.$$typeof===b||e.$$typeof===O||e.$$typeof===w||e.$$typeof===y)},t.typeOf=x},953:function(e,t){e.exports=function(e){if(navigator.clipboard)return navigator.clipboard.writeText(e).catch((function(e){throw void 0!==e?e:new DOMException("The request is not allowed","NotAllowedError")}));var t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);var n=window.getSelection(),r=window.document.createRange();n.removeAllRanges(),r.selectNode(t),n.addRange(r);var i=!1;try{i=window.document.execCommand("copy")}catch(e){console.log("error",e)}return n.removeAllRanges(),window.document.body.removeChild(t),i?Promise.resolve():Promise.reject(new DOMException("The request is not allowed","NotAllowedError"))}},954:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useTimedToggle=void 0;var r=n(0);t.useTimedToggle=function(e){var t=r.useState(!1),n=t[0],i=t[1],o=r.useRef(),a=r.useRef(e);return r.useEffect((function(){return function(){return clearTimeout(o.current)}}),[]),[n,function(e){clearTimeout(o.current),i(!a.current),o.current=window.setTimeout((function(){return i(a.current)}),e)}]}},957:function(e,t,n){"use strict";var r=n(0),i=n(958);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n